aws / aws-iot-device-sdk-embedded-C

SDK for connecting to AWS IoT from a device using embedded C.
MIT License
979 stars 630 forks source link

return negative value when byteToSend/Recv is 0 #1774

Closed ActoryOu closed 2 years ago

ActoryOu commented 2 years ago

Issue #, if available:

Description of changes: refer to API reference

Openssl_Recv should return negative value when byteToRecv is 0. Openssl_Send should return negative value when byteToSend is 0.

TransportRecv_t:

If no data is available on the network to read and no error has occurred, zero MUST be the return value. A zero return value SHOULD represent that the read operation can be retried by calling the API function. Zero MUST NOT be returned if a network disconnection has occurred.

TransportSend_t:

If no data is transmitted over the network due to a full TX buffer and no network error has occurred, this MUST return zero as the return value. A zero return value SHOULD represent that the send operation can be retried by calling the API function. Zero MUST NOT be returned if a network disconnection has occurred.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.