mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-23 11:45:42 +01:00
Allow 0 as a valid ret value for mbedtls_ssl_write
This patch modifies the documentation for mbedtls_ssl_write() to allow 0 as a valid return value as this is the correct number of bytes that should be returned when an empty TLS Application record is sent.
This commit is contained in:
parent
45bc7db600
commit
b4d008430c
@ -2213,17 +2213,19 @@ int mbedtls_ssl_read( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len )
|
|||||||
* or MBEDTLS_ERR_SSL_WANT_WRITE of MBEDTLS_ERR_SSL_WANT_READ,
|
* or MBEDTLS_ERR_SSL_WANT_WRITE of MBEDTLS_ERR_SSL_WANT_READ,
|
||||||
* or another negative error code.
|
* or another negative error code.
|
||||||
*
|
*
|
||||||
* \note If this function returns something other than a positive
|
* \note If this function returns something other than 0, a positive
|
||||||
* value or MBEDTLS_ERR_SSL_WANT_READ/WRITE, the ssl context
|
* value or MBEDTLS_ERR_SSL_WANT_READ/WRITE, you must stop
|
||||||
* becomes unusable, and you should either free it or call
|
* using the SSL context for reading or writing, and either
|
||||||
* \c mbedtls_ssl_session_reset() on it before re-using it for
|
* free it or call \c mbedtls_ssl_session_reset() on it before
|
||||||
* a new connection; the current connection must be closed.
|
* re-using it for a new connection; the current connection
|
||||||
|
* must be closed.
|
||||||
*
|
*
|
||||||
* \note When this function returns MBEDTLS_ERR_SSL_WANT_WRITE/READ,
|
* \note When this function returns MBEDTLS_ERR_SSL_WANT_WRITE/READ,
|
||||||
* it must be called later with the *same* arguments,
|
* it must be called later with the *same* arguments,
|
||||||
* until it returns a positive value. When the function returns
|
* until it returns a value greater that or equal to 0. When
|
||||||
* MBEDTLS_ERR_SSL_WANT_WRITE there may be some partial
|
* the function returns MBEDTLS_ERR_SSL_WANT_WRITE there may be
|
||||||
* data in the output buffer, however this is not yet sent.
|
* some partial data in the output buffer, however this is not
|
||||||
|
* yet sent.
|
||||||
*
|
*
|
||||||
* \note If the requested length is greater than the maximum
|
* \note If the requested length is greater than the maximum
|
||||||
* fragment length (either the built-in limit or the one set
|
* fragment length (either the built-in limit or the one set
|
||||||
@ -2232,6 +2234,9 @@ int mbedtls_ssl_read( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len )
|
|||||||
* - with DTLS, MBEDTLS_ERR_SSL_BAD_INPUT_DATA is returned.
|
* - with DTLS, MBEDTLS_ERR_SSL_BAD_INPUT_DATA is returned.
|
||||||
* \c mbedtls_ssl_get_max_frag_len() may be used to query the
|
* \c mbedtls_ssl_get_max_frag_len() may be used to query the
|
||||||
* active maximum fragment length.
|
* active maximum fragment length.
|
||||||
|
*
|
||||||
|
* \note Attempting to write 0 bytes will result in an empty TLS
|
||||||
|
* application record being sent.
|
||||||
*/
|
*/
|
||||||
int mbedtls_ssl_write( mbedtls_ssl_context *ssl, const unsigned char *buf, size_t len );
|
int mbedtls_ssl_write( mbedtls_ssl_context *ssl, const unsigned char *buf, size_t len );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user