Function s2n_tls_sys::s2n_peek_buffered
source · pub unsafe extern "C" fn s2n_peek_buffered(
conn: *mut s2n_connection
) -> u32
Expand description
Reports how many bytes of unprocessed TLS records are buffered due to the optimization
enabled by s2n_connection_set_recv_buffering
.
s2n_peek_buffered
is not a replacement for s2n_peek
.
While s2n_peek
reports application data that is ready for the application
to read with no additional processing, s2n_peek_buffered
reports raw TLS
records that still need to be parsed and likely decrypted. Those records may
contain application data, but they may also only contain TLS control messages.
If an application needs to determine whether there is any data left to handle
(for example, before calling poll
to wait on the read file descriptor) then
that application must check both s2n_peek
and s2n_peek_buffered
.
@param conn A pointer to the s2n_connection object @returns The number of buffered encrypted bytes