On Sat, Aug 19, 2006 at 10:27:52PM +0200, Marek Marcola wrote: > I'm not sure if this is good solution because this will give > you semi-blocking behaviour (we are only in non-blocking wrapper > and checking for read/write is done by select() in "upper" layer).
You're right; I don't want blocking behaviour. The non-SSL part of the code solves this by select()ing on the readable file descriptors and only calling read() when there is something to be read. > You should change loop ending condition - this loop should end > when SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE occur because > this errors may be returned on non-blocking sockets on SSL_read() > and on SSL_write(). On normal use this will happen mostly where > re-handshake is going on but this may happen where empty SSL fragments > are sent over network (of course this may happen on some system > condition too). I'm a little unclear on how this should be implemented.. so if I call SSL_read, get -1 back, and err = SSL_ERROR_WANT_READ, do I just call SSL_read again? Because that's what I've been doing and it ends up in an infinite loop. Also, is err = SSL_ERROR_WANT_WRITE, but I have no data to write (because I'm waiting to see what the server sends me before replying), what should I write in my call to SSL_write? Thanks, Steve. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]