diff options
author | Matt Caswell <matt@openssl.org> | 2016-10-21 16:16:20 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-11-04 12:09:46 +0000 |
commit | 6782e5fdd885cbd09ecbc063f3c1116c2962ecae (patch) | |
tree | 5c0f303388a43b0e59ae85aa656f784b929f936a /doc/man3/SSL_write.pod | |
parent | d0ee717c938cda00bcb13cac2f7e2b162616254b (diff) | |
download | openssl-6782e5fdd885cbd09ecbc063f3c1116c2962ecae.tar.gz |
Updates various man pages based on review feedback received.
Improvements to style, grammar etc.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'doc/man3/SSL_write.pod')
-rw-r--r-- | doc/man3/SSL_write.pod | 74 |
1 files changed, 35 insertions, 39 deletions
diff --git a/doc/man3/SSL_write.pod b/doc/man3/SSL_write.pod index 45b34a4ff7..98d691a26c 100644 --- a/doc/man3/SSL_write.pod +++ b/doc/man3/SSL_write.pod @@ -19,59 +19,55 @@ of bytes written in B<*written>. =head1 NOTES -If necessary, SSL_write_ex() or SSL_write() will negotiate a TLS/SSL session, if -not already explicitly performed by L<SSL_connect(3)> or -L<SSL_accept(3)>. If the -peer requests a re-negotiation, it will be performed transparently during -the SSL_write_ex() or SSL_write() operation. The behaviour of SSL_write_ex() or -SSL_write() depends on the underlying BIO. +In the paragraphs below a "write function" is defined as one of either +SSL_write_ex(), or SSL_write(). + +If necessary, a write function will negotiate a TLS/SSL session, if not already +explicitly performed by L<SSL_connect(3)> or L<SSL_accept(3)>. If the peer +requests a re-negotiation, it will be performed transparently during +the write functio operation. The behaviour of the write functions depends on the +underlying BIO. For the transparent negotiation to succeed, the B<ssl> must have been initialized to client or server mode. This is being done by calling L<SSL_set_connect_state(3)> or SSL_set_accept_state() -before the first call to an L<SSL_read_ex(3)>, L<SSL_read(3)>, SSL_write_ex() or -SSL_write() function. +before the first call to a write function. -If the underlying BIO is B<blocking>, SSL_write_ex() and SSL_write() will only -return, once the write operation has been finished or an error occurred, except -when a renegotiation take place, in which case a SSL_ERROR_WANT_READ may occur. +If the underlying BIO is B<blocking>, the write functions will only return, once +the write operation has been finished or an error occurred, except when a +renegotiation take place, in which case a SSL_ERROR_WANT_READ may occur. This behaviour can be controlled with the SSL_MODE_AUTO_RETRY flag of the L<SSL_CTX_set_mode(3)> call. -If the underlying BIO is B<non-blocking>, SSL_write_ex() or SSL_write() will -also return, when the underlying BIO could not satisfy the needs of -SSL_write_ex() or SSL_write() to continue the operation. In this case a call to -L<SSL_get_error(3)> with the -return value of SSL_write_ex() or SSL_write() will yield B<SSL_ERROR_WANT_READ> +If the underlying BIO is B<non-blocking> the write functions will also return +when the underlying BIO could not satisfy the needs of the function to continue +the operation. In this case a call to L<SSL_get_error(3)> with the +return value of the write function will yield B<SSL_ERROR_WANT_READ> or B<SSL_ERROR_WANT_WRITE>. As at any time a re-negotiation is possible, a -call to SSL_write_ex() or SSL_write() can also cause read operations! The -calling process then must repeat the call after taking appropriate action to -satisfy the needs of SSL_write_ex() or SSL_write(). The action depends on the -underlying BIO. When using a non-blocking socket, nothing is to be done, but -select() can be used to check for the required condition. When using a buffering -BIO, like a BIO pair, data must be written into or retrieved out of the BIO -before being able to continue. - -SSL_write_ex() or SSL_write() will only return with success, when the complete -contents of B<buf> of length B<num> has been written. This default behaviour -can be changed with the SSL_MODE_ENABLE_PARTIAL_WRITE option of -L<SSL_CTX_set_mode(3)>. When this flag is set, -SSL_write_ex() or SSL_write() will also return with success, when a partial -write has been successfully completed. In this case the SSL_write_ex() or -SSL_write() operation is considered completed. The bytes are sent and a new -SSL_write_ex() or SSL_write() operation with a new -buffer (with the already sent bytes removed) must be started. -A partial write is performed with the size of a message block, which is -16kB for SSLv3/TLSv1. +call to a write function can also cause read operations! The calling process +then must repeat the call after taking appropriate action to satisfy the needs +of the write function. The action depends on the underlying BIO. When using a +non-blocking socket, nothing is to be done, but select() can be used to check +for the required condition. When using a buffering BIO, like a BIO pair, data +must be written into or retrieved out of the BIO before being able to continue. + +The write functions will only return with success when the complete contents of +B<buf> of length B<num> has been written. This default behaviour can be changed +with the SSL_MODE_ENABLE_PARTIAL_WRITE option of L<SSL_CTX_set_mode(3)>. When +this flag is set the write functions will also return with success when a +partial write has been successfully completed. In this case the write function +operation is considered completed. The bytes are sent and a new write call with +a new buffer (with the already sent bytes removed) must be started. A partial +write is performed with the size of a message block, which is 16kB. =head1 WARNING -When an SSL_write_ex() or SSL_write() operation has to be repeated because of -B<SSL_ERROR_WANT_READ> or B<SSL_ERROR_WANT_WRITE>, it must be repeated +When a write function call has to be repeated because L<SSL_get_error(3)> +returned B<SSL_ERROR_WANT_READ> or B<SSL_ERROR_WANT_WRITE>, it must be repeated with the same arguments. -When calling SSL_write_ex() or SSL_write() with num=0 bytes to be sent the -behaviour is undefined. +When calling the write functions with num=0 bytes to be sent the behaviour is +undefined. =head1 RETURN VALUES |