> I believe that this is now wrong, and alreay was wrong in 0.6.6b. ...
> if you really want to avoid blocks, you must use non-blocking I/O.
> Am I right?

I don't think so.  We use select() with blocking I/O on UNIX (async
select on Windows), and rely on (mostly?) non-blocking behaviour, at
least after connection establishment (which is blocking in OpenUI
anyway).

It's a little ugly - we use approximately the following code in our
read() function (triggered after select() says it's readable):

        while ((ret_val = SSL_read(ssl, buf_p, len)) <= 0
                && (rbio = SSL_get_rbio(ssl))
                && BIO_should_retry(rbio)
                && LastError() != WOULDBLOCK)
                ;

LastError() is a macro that does the cross-platform errno/WSAGetLastError()
thing.

I believe that this code doesn't ever block, with the proviso that connection
establishment is already complete.  I'd very much like to retain this
capability.

-- 
Clifford Heath                    http://www.osa.com.au/~cjh
Open Software Associates Limited       mailto:[EMAIL PROTECTED]
29 Ringwood Street / PO Box 4414       Phone  +613 9871 1694
Ringwood VIC 3134      AUSTRALIA       Fax    +613 9871 1711
------------------------------------------------------------
Proven Solution Deployment for the Global Enterprise


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to