@@ -9,17 +9,17 @@ SSL_read_ex, SSL_read, SSL_peek_ex, SSL_peek
99
1010 #include <openssl/ssl.h>
1111
12- int SSL_read_ex(SSL *ssl, void *buf, size_t num, size_t *read );
12+ int SSL_read_ex(SSL *ssl, void *buf, size_t num, size_t *readbytes );
1313 int SSL_read(SSL *ssl, void *buf, int num);
1414
15- int SSL_peek_ex(SSL *ssl, void *buf, size_t num, size_t *read );
15+ int SSL_peek_ex(SSL *ssl, void *buf, size_t num, size_t *readbytes );
1616 int SSL_peek(SSL *ssl, void *buf, int num);
1717
1818=head1 DESCRIPTION
1919
2020SSL_read_ex() and SSL_read() try to read B<num> bytes from the specified B<ssl>
2121into the buffer B<buf>. On success SSL_read_ex() will store the number of bytes
22- actually read in B<*read >.
22+ actually read in B<*readbytes >.
2323
2424SSL_peek_ex() and SSL_peek() are identical to SSL_read_ex() and SSL_read()
2525respectively except no bytes are actually removed from the underlying BIO during
@@ -90,38 +90,32 @@ with the same arguments.
9090
9191SSL_read_ex() and SSL_peek_ex() will return 1 for success or 0 for failure.
9292Success means that 1 or more application data bytes have been read from the SSL
93- connection. Failure means that no bytes could be read from the SSL connection.
93+ connection.
94+ Failure means that no bytes could be read from the SSL connection.
9495Failures can be retryable (e.g. we are waiting for more bytes to
95- be delivered by the network) or non-retryable (e.g. a fatal network error). In
96- the event of a failure call L<SSL_get_error(3)> to find out the reason which
96+ be delivered by the network) or non-retryable (e.g. a fatal network error).
97+ In the event of a failure call L<SSL_get_error(3)> to find out the reason which
9798indicates whether the call is retryable or not.
9899
99100For SSL_read() and SSL_peek() the following return values can occur:
100101
101102=over 4
102103
103- =item E<gt>0
104+ =item E<gt> 0
104105
105- The read operation was successful; the return value is the number of
106- bytes actually read from the TLS/SSL connection.
106+ The read operation was successful.
107+ The return value is the number of bytes actually read from the TLS/SSL
108+ connection.
107109
108- =item Z<>0
110+ =item Z<><= 0
109111
110- The read operation was not successful. The reason may either be a clean
111- shutdown due to a "close notify" alert sent by the peer (in which case
112- the SSL_RECEIVED_SHUTDOWN flag in the ssl shutdown state is set
113- (see L<SSL_shutdown(3)>,
114- L<SSL_set_shutdown(3)>). It is also possible, that
115- the peer simply shut down the underlying transport and the shutdown is
116- incomplete. Call SSL_get_error() with the return value B<ret> to find out,
117- whether an error occurred or the connection was shut down cleanly
118- (SSL_ERROR_ZERO_RETURN).
112+ The read operation was not successful, because either the connection was closed,
113+ an error occurred or action must be taken by the calling process.
114+ Call L<SSL_get_error(3)> with the return value B<ret> to find out the reason.
119115
120- =item E<lt>0
121-
122- The read operation was not successful, because either an error occurred
123- or action must be taken by the calling process. Call SSL_get_error() with the
124- return value B<ret> to find out the reason.
116+ Old documentation indicated a difference between 0 and -1, and that -1 was
117+ retryable.
118+ You should instead call SSL_get_error() to find out if it's retryable.
125119
126120=back
127121
0 commit comments