I am not 100% sure I understand your question.

It is necessary that I make a very simple HTTPS "browser" in one thread and a very simple HTTPS "server" in another thread. I'd like to make the HTTPS "browser" thread impervious (not get hung in a blocking state) to web servers that are rebooted at any time during a socket/HTTPS session or CGI/PHP scripts that it is talking to. Likewise, I'd like to make the HTTPS "server" program impervious (not get hung in a blocking state) to full-fledged web browsers or CGI/PHP scripts acting like simple web browsers. I'd be surprised if I couldn't get in a blocking hung state if the SSL_read() and SSL_write() operations were being run over a blocking socket connection, but I'm not sure I need to leave all of the other SSL function calls running over a non-blocking socket and wrap a lot of code around them to deal with the SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE/etc. return values.

Sorry for the confusion. I hope this is making sense now.

Joe



David Schwartz wrote:
Is it "safe" to put just SSL_read() and SSL_write() inside the
non-blocking BIO regions and leaving SSL_accept(), SSL_connect(),
SSL_shutdown(), accept(), socket(), bind(), listen(), connect(),
shutdown(), close(), SSL_CTX_new(meth),  SSL_new(ctx),
SSL_CTX_free(ctx), etc. in the blocking BIO regions?

David Schwartz are you listening I hope?

        I am not 100% sure I understand your question. But it should be 
perfectly
safe and legal to create a socket in blocking mode, perform blocking
operations to establish the connection, then switch the socket to
non-blocking mode and use the connection in non-blocking mode with
non-blocking operations. It should similarly be safe to set the socket to
blocking mode and then tear down the connection with blocking operations.

        The only problem I can think of would be that while the socket is 
blocking,
operations can always block. However, if you only set the socket blocking
and call functions that you want to block, I can't see any possible problem.

        I have never done anything like this, however.

        DS


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to