On Fri, Apr 23, 2004, Lukasz Wójcicki wrote: > > > > > > I read about non blocking IO in documentation of OpenSSL. There is > written > > > that I have to call SSL_write when I get SSL_ERROR_WRITE. What I'm doing > bad > > > ? > > > > > > > Where does it say that? In general you should wait until the condition has > > been satisfied (in this case that its OK to write data) and retry the > failed > > call. > > > > "If the underlying BIO is 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(3) with the return value > of SSL_write() will yield SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE. As at > any time a re-negotiation is possible, a call to 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()" >
That doesn't actually say you have to call SSL_write() when you get SSL_ERROR_WANT_WRITE irrespctive of the source. It says if SSL_write() returns SSL_ERROR_WANT_WRITE you call SSL_write(). The general rule is that you retry the failed call which doesn't have to be SSL_write(). Steve. -- Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage OpenSSL project core developer and freelance consultant. Funding needed! Details on homepage. Homepage: http://www.drh-consultancy.demon.co.uk ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]