Hi
Here
http://marc.info/?l=openssl-users&m=124386218929227
It states that

"...This is why it is very important to understand that any possible forward 
progress on any port (and a write operation that returns WANT_READ may have 
made forward progress!) requires you to retry all pending operations on all 
ports...."

So am I correct in understanding that an SSL_read() that returned WANT_READ may 
have made forward progress (even if it did not return any data)?

I have an event driven single threaded app that has 3 non blocking ssl sockets. 
When each socket completes its connection, I have the sockets read until I get 
a WANT_READ. My understanding is that a WANT_READ means I may now invoke 
select() and wait until the socket is ready for reading again.

When select() returns, a loop goes through the 3 sockets calling ssl_read() on 
each of them.

Say a read on Socket 1 returned WANT_READ and no data.
Is it possible that Socket 2 may return WANT_READ, returns some data, and has 
now made some progress such that a read on socket 1 may now return data? But as 
the loop has already done the read for socket 1, it will not happen.

As the loop has run through the 3 sockets, it waits there and hangs. Could this 
situation happen?

If this is the case, how do I tell no more progress can be made on all 3 
sockets?
For example, say the loop runs through; 

-socket 1 returns WANT_READ. 
-socket 2 returns some data, then WANT_READ (and makes progress such that 
socket 1 can now return data)
-socket 3 returns WANT_READ. 

But based on the quote above (where any forward progress requires retrying all 
pending operations), I should retry all sockets again; so the second run 
through the loop;

-socket 1 now returns data, then WANT_READ
-socket 2 returns WANT_READ
-socket 3 now returns data (because the read on socket 1 made enough progress 
for socket 3 to return data), then WANT_READ.

But what if the last read made progress such that socket 2 now returns data 
again? So my question is (if my understanding is correct), how do I tell in 
this instance how many times I'd need to run through the loop?

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

Reply via email to