This is a discussion on RE: how do I determine blocking or nonblocking? - Openssl ; > Documentation tells me that the SSL pointer should inherit > the blocking property from the socket passed to SSL_set_fd. Right. > However, when I call SSL_shutdown with the SSL handle, > the return code I get is not an ...
> Documentation tells me that the SSL pointer should inherit
> the blocking property from the socket passed to SSL_set_fd.
> However, when I call SSL_shutdown with the SSL handle,
> the return code I get is not an error or a shutdown completed
> but a shutdown in progress (return code= 0).
Which is pretty much the same as every other operation. If you call 'send'
or 'write' on a blocking TCP socket, and you get a zero return, does that
mean the data has been sent? No. It means the data is queued and the send is
in progress. If you call 'shutdown' on a blocking socket and get a zero
return, does that mean the connection has finished shutting down? No. It
means the shutdown is in progress.
> Documentation tells me that the shutdown will not return until
> the shutdown is completed (return code= 1) or an error condition
> is detected (return code= -1) if the SSL handle is blocking.
I'm not sure what documentation that is, but it's incorrect.
> So now I am confused. How can I test the SSL handle to find
> out if it is blocking or not?
The operation will only block if it has to. Operations won't gratuitously
block. Specifically, operations try as hard as they can *not* to block until
the other side does things unless that is necessary to take the data passed
or give the data that needs to be returned.
OpenSSL Project http://www.openssl.org
User Support Mailing List firstname.lastname@example.org
Automated List Manager email@example.com