RE: SSL_accept hangs
> Hi David,[/color]
> My code looks like this:[/color]
3 r = SSL_accept(m_ssl);
4 if (r > 0)
8 r = ssl_retry(r);
9 if ( r <= 0)
Well, that's obviously badly broken. It's probably not precisely your issue,
but it's related. Since the socket is non blocking, there is no place for
this code to block waiting for the connection!
> The issue is not that it is going into an infinite while loop.[/color]
That's just pure luck.
> The issue is that SSL_accept on line 3 never returns!.
> My socket is a non blocking one so as far as I know
> SSL_accept should return.[/color]
How did you make it non blocking exactly? And is the BIO non-blocking too?
> A backtrace shows that when this happen the server gets stuck in:[/color]
> after calling SSL_accept.[/color]
Sounds like you're lucky. The BIO is actually blocking and that's saving
your code from looping. At least you're not burning the CPU. ;)
What is your design intention if 'accept' returns EMFILE or ENFILE? If your
answer is "I have no idea" or "I never really thought about it", then it's
no surprise your code mishandles this case.
OpenSSL Project [url]http://www.openssl.org[/url]
User Support Mailing List [email]email@example.com[/email]
Automated List Manager [email]firstname.lastname@example.org[/email]