Kyle Hamilton wrote:
My understanding is that if SSL_ERROR_WANT_WRITE happened with
SSL_read(), the next SSL_read() would actually call write() to make
the forward progress.

Yes that is possible, as the data for the write is already inside OpenSSL library. Infact all the write to BIO/kernel does (in this case) is push already encrypted data that has been prepared (but was not written to BIO/kernel) from a previous SSL_write(). It doesn't actually prepare any new application data for encryption, this is what I called an attempt to "flush" the data downwards (when I discussed SSL_shutdown() issues in that bug that has now been fixed).

I suggested the SSL_read() with -1/WANT_WRITE special condition would be handled the same way as the reverse, since that is an easy way for a new user to understand.

This situation is also rarer to observe, but easiest to get right.

New users should deal with the SSL_write() with -1/WANT_READ first since that special condition has a few more caveats to it.


Darryl
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to