RE: SSL_accept hangs
> Well, that is not true and I am sorry I did not give
> you the full code as it is quite complicated but the
> snipet you see above is called after a new connection
> is already accepted. So I have an outer loop that does
> a select and once a new connection is detected and accepted
> without errors, I go ahead establishing the ssl part... Something like:[/color]
ready_sockets = ::select(m_max_socket + 1, rfds, 0, 0,&tv);
if (ready_sockets > 0)
call the code above which will call SSL_accept
Where is the call to 'accept' (the system's 'accept')? Did you cut out a
line before 'new_s->set_non_blocking'? Is 's->accept(new_s)' a wrapper
around 'accept'? Can you paste the code to this wrapper?
> I am setting the socket as non blocking by simply calling:[/color]
if (fcntl(m_sock_fd, F_SETFL, O_NONBLOCK) == -1)
This does not make the BIO non-blocking. That may or may not matter, but to
tell I need to see where the actual call to the system's 'accept' function
is taking place. And you still haven't pasted that code.
> I am confused when you say if my BIO is non-blocking too.
> I thought that it is non blocking since the underlying socket
> is non blocking. Is this a wrong assumption? if so how can I make
> the BIO non blocking [BIO_set_nbio?][/color]
Right. A blocking BIO with a non-blocking socket can cause serious problems.
Where is the actual call to 'accept' to accept the connection? What happens
if 'accept' returns EMFILE or ENFILE?
OpenSSL Project [url]http://www.openssl.org[/url]
User Support Mailing List [email]firstname.lastname@example.org[/email]
Automated List Manager [email]email@example.com[/email]