ssl_write.pod
来自「一个用于点对点传输加密的工具包源码」· POD 代码 · 共 77 行
POD
77 行
=pod=head1 NAMESSL_read - write bytes to a TLS/SSL connection.=head1 SYNOPSIS #include <openssl/ssl.h> int SSL_write(SSL *ssl, char *buf, int num);=head1 DESCRIPTIONSSL_write() writes B<num> bytes from the buffer B<buf> into the specifiedB<ssl> connection.=head1 NOTESIf necessary, SSL_write() 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_write() operation. The behaviour of SSL_write() depends on theunderlying BIO. If the underlying BIO is B<blocking>, SSL_write() will only return, once thewrite operation has been finished or an error occurred.If the underlying BIO is B<non-blocking>, SSL_write() will also return,when the underlying BIO could not satisfy the needs of SSL_write()to continue the operation. In this case a call to SSL_get_error() with thereturn value of SSL_write() will yield B<SSL_ERROR_WANT_READ> orB<SSL_ERROR_WANT_WRITE>. As at any time a re-negotiation is possible, acall to SSL_write() can also cause write operations! The calling processthen must repeat the call after taking appropriate action to satisfy theneeds of SSL_write(). 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_write() 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 write operation was successful, the return value is the number ofbytes actually written to the TLS/SSL connection.=item 0The write operation was not successful. Call SSL_get_error() with the returnvalue 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_read(3)|SSL_read(3)>,L<ssl(3)|ssl(3)>, L<bio(3)|bio(3)>=cut
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?