On Fri, 9 Dec 2011 09:08:19 -0600
"Michael S. Zick" <open...@morethan.org> wrote:
> On Fri December 9 2011, MK wrote:
> > What makes you believe I am not handling this correctly?  If the the
> > call returns WANT_WRITE or WANT_READ,  it gets called again with
> > exactly the same parameters, which is exactly what that and all
> > those other zillion posts recommend.  This is why I set the err to
> > EAGAIN, because the same thing must be done with a regular
> > non-blocking socket.
> >
> 
> Because the write action might return __either__ want_read or
> want_write and the read action might return __either__ want_read or
> want_write. 
> 
> Just because the most current action was a "write" does not mean you
> can presume the return was "want_write" - it might be "want_read".
> 
> The same is true if the most current action was a "read".

Yes, but WRT non-blocking sockets (it says "non-blocking" in the OP),
from the SSL_read man page:

"As at any time a re-negotiation is possible, a call to SSL_read() can
also cause write operations! The calling process then must repeat the
call after taking appropriate action to satisfy the needs of SSL_read
(). The action depends on the underlying BIO . When using a
non-blocking socket, *nothing is to be done*..."

You just call the read again, regardless of whether it is WANT_READ or
WANT_WRITE.  This is also quoted in the link you posted ;)

The actual problem is solved in one of the other replies, but thanks
for taking an interest.

Sincerely, MK

-- 
"Enthusiasm is not the enemy of the intellect." (said of Irving Howe)
"The angel of history[...]is turned toward the past." (Walter Benjamin)

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

Reply via email to