Function esp_idf_hal::sys::mbedtls_ssl_conf_max_frag_len
source · pub unsafe extern "C" fn mbedtls_ssl_conf_max_frag_len(
conf: *mut mbedtls_ssl_config,
mfl_code: u8,
) -> i32
Expand description
\brief Set the maximum fragment length to emit and/or negotiate.
(Typical: the smaller of #MBEDTLS_SSL_IN_CONTENT_LEN and
#MBEDTLS_SSL_OUT_CONTENT_LEN, usually 2^14
bytes)
(Server: set maximum fragment length to emit,
usually negotiated by the client during handshake)
(Client: set maximum fragment length to emit and
negotiate with the server during handshake)
(Default: #MBEDTLS_SSL_MAX_FRAG_LEN_NONE)
\note On the client side, the maximum fragment length extension will not be used, unless the maximum fragment length has been set via this function to a value different than #MBEDTLS_SSL_MAX_FRAG_LEN_NONE.
\note With TLS, this currently only affects ApplicationData (sent with \c mbedtls_ssl_read()), not handshake messages. With DTLS, this affects both ApplicationData and handshake.
\note This sets the maximum length for a record’s payload, excluding record overhead that will be added to it, see \c mbedtls_ssl_get_record_expansion().
\note For DTLS, it is also possible to set a limit for the total size of datagrams passed to the transport layer, including record overhead, see \c mbedtls_ssl_set_mtu().
\param conf SSL configuration \param mfl_code Code for maximum fragment length (allowed values: MBEDTLS_SSL_MAX_FRAG_LEN_512, MBEDTLS_SSL_MAX_FRAG_LEN_1024, MBEDTLS_SSL_MAX_FRAG_LEN_2048, MBEDTLS_SSL_MAX_FRAG_LEN_4096)
\return 0 if successful or MBEDTLS_ERR_SSL_BAD_INPUT_DATA