ssl_read.pod

来自「一个用于点对点传输加密的工具包源码」· POD 代码 · 共 78 行

POD
78
字号
=pod=head1 NAMESSL_read - read bytes from a TLS/SSL connection.=head1 SYNOPSIS #include <openssl/ssl.h> int SSL_read(SSL *ssl, char *buf, int num);=head1 DESCRIPTIONSSL_read() tries to read B<num> bytes from the specified B<ssl> into thebuffer B<buf>.=head1 NOTESIf necessary, SSL_read() will negotiate a TLS/SSL session, ifnot already explicitly performed by SSL_connect() or SSL_accept(). If thepeer requests a re-negotiation, it will be performed transparently duringthe SSL_read() operation. The behaviour of SSL_read() depends on theunderlying BIO. If the underlying BIO is B<blocking>, SSL_read() will only return, once theread operation has been finished or an error occurred.If the underlying BIO is B<non-blocking>, SSL_read() will also returnwhen the underlying BIO could not satisfy the needs of SSL_read()to continue the operation. In this case a call to SSL_get_error() with thereturn value of SSL_read() will yield B<SSL_ERROR_WANT_READ> orB<SSL_ERROR_WANT_WRITE>. As at any time a re-negotiation is possible, acall to SSL_read() can also cause write operations! The calling processthen must repeat the call after taking appropriate action to satisfy theneeds of SSL_read(). The action depends on the underlying BIO. When using anon-blocking socket, nothing is to be done, but select() can be used to checkfor the required condition. When using a buffering BIO, like a BIO pair, datamust be written into or retrieved out of the BIO before being able to continue.=head1 WARNINGWhen an SSL_read() operation has to be repeated because ofB<SSL_ERROR_WANT_READ> or B<SSL_ERROR_WANT_WRITE>, it must be repeatedwith the same arguments.=head1 RETURN VALUESThe following return values can occur:=over 4=item E<gt>0The read operation was successful; the return value is the number ofbytes actually read from the TLS/SSL connection.=item 0The read operation was not successful, probably because no data wasavailable. Call SSL_get_error() with the return value B<ret> to find out,whether an error occurred.=item -1The read operation was not successful, because either an error occurredor action must be taken by the calling process. Call SSL_get_error() with thereturn value B<ret> to find out the reason.=back=head1 SEE ALSOL<SSL_get_error(3)|SSL_get_error(3)>, L<SSL_write(3)|SSL_write(3)>,L<ssl(3)|ssl(3)>, L<bio(3)|bio(3)>=cut

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?