pub unsafe extern "C" fn s2n_recv(
conn: *mut s2n_connection,
buf: *mut c_void,
size: isize,
blocked: *mut u32
) -> isize
Expand description
Decrypts and reads *size to buf
data from the associated
connection.
@note Unlike OpenSSL, repeated calls to s2n_recv
should not duplicate the original parameters, but should update buf
and size
per the indication of size read.
See the following example for guidance on calling s2n_recv()
:
https://github.com/aws/s2n-tls/blob/main/docs/examples/s2n_recv.c
@param conn A pointer to the s2n_connection object
@param buf A pointer to a buffer that s2n will place read data into.
@param size Size of buf
@param blocked A pointer which will be set to the blocked status if an S2N_ERR_T_BLOCKED
error is returned.
@returns The number of bytes read on success. 0 if the connection was shutdown by the peer. S2N_FAILURE on failure.