Sortix cisortix manual
This manual documents Sortix cisortix. You can instead view this document in the latest official manual.
NAME
SSL_read_ex, SSL_read, SSL_peek_ex, SSL_peek — read bytes from a TLS connectionSYNOPSIS
#include <openssl/ssl.h>SSL_read_ex(SSL *ssl, void *buf, size_t num, size_t *readbytes);
SSL_read(SSL *ssl, void *buf, int num);
SSL_peek_ex(SSL *ssl, void *buf, size_t num, size_t *readbytes);
SSL_peek(SSL *ssl, void *buf, int num);
DESCRIPTION
SSL_read_ex() and SSL_read() try to read num bytes from the specified ssl into the buffer buf. On success SSL_read_ex() stores the number of bytes actually read in *readbytes.RETURN VALUES
SSL_read_ex() and SSL_peek_ex() return 1 for success or 0 for failure. Success means that one or more application data bytes have been read from the SSL connection. Failure means that no bytes could be read from the SSL connection. Failures can be retryable (e.g. we are waiting for more bytes to be delivered by the network) or non-retryable (e.g. a fatal network error). In the event of a failure, call SSL_get_error(3) to find out the reason which indicates whether the call is retryable or not.- >0
- The read operation was successful. The return value is the number of bytes actually read from the TLS connection.
- 0
- The read operation was not successful. The reason may either be a clean shutdown due to a “close notify” alert sent by the peer (in which case the SSL_RECEIVED_SHUTDOWN flag in the ssl shutdown state is set (see SSL_shutdown(3) and SSL_set_shutdown(3)). It is also possible that the peer simply shut down the underlying transport and the shutdown is incomplete. Call SSL_get_error(3) with the return value to find out whether an error occurred or the connection was shut down cleanly (SSL_ERROR_ZERO_RETURN).
- <0
- The read operation was not successful, because either an error occurred or action must be taken by the calling process. Call SSL_get_error(3) with the return value to find out the reason.