Function bearssl::br_sslio_write [] [src]

pub unsafe extern "C" fn br_sslio_write(
    cc: *mut br_sslio_context,
    src: *const c_void,
    len: usize
) -> c_int

\brief Write some application data unto a SSL connection.

If len is zero, then this function returns 0 immediately. In all other cases, it never returns 0.

This call returns only when at least one byte has been written. Returned value is the number of bytes written, or -1 on error. The number of bytes always fits on an 'int' (less than 20000).

On error or SSL closure, this function returns -1. The caller should inspect the error status on the SSL engine to distinguish between normal closure and error.

Important: SSL is buffered; a "written" byte is a byte that was injected into the wrapped SSL engine, but this does not necessarily mean that it has been scheduled for sending. Use br_sslio_flush() to ensure that all pending data has been sent to the transport medium.

\param cc SSL wrapper context. \param src source buffer for application data. \param len maximum number of bytes to write. \return number of bytes written, or -1 on error.