Merge pull request #4807 from hanno-arm/bio_recv_ret_0_eof

Document that returning 0 from the recv callback means EOF
This commit is contained in:
Manuel Pégourié-Gonnard 2021-08-17 10:30:46 +02:00 committed by GitHub
commit 684543a3a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -543,10 +543,11 @@ typedef int mbedtls_ssl_send_t( void *ctx,
* \param buf Buffer to write the received data to
* \param len Length of the receive buffer
*
* \return The callback must return the number of bytes received,
* or a non-zero error code.
* If performing non-blocking I/O, \c MBEDTLS_ERR_SSL_WANT_READ
* \returns If data has been received, the positive number of bytes received.
* \returns \c 0 if the connection has been closed.
* \returns If performing non-blocking I/O, \c MBEDTLS_ERR_SSL_WANT_READ
* must be returned when the operation would block.
* \returns Another negative error code on other kinds of failures.
*
* \note The callback may receive fewer bytes than the length of the
* buffer. It must always return the number of bytes actually