[Dovecot] imap-login hanging when firewall blocks ssl handshaking

Timo Sirainen tss at iki.fi
Fri Nov 30 00:39:51 EET 2012


On 30.11.2012, at 0.12, Ben Morrow wrote:

>> This change isn't very reliable, since the previous call might not
>> have been read().. I wonder if something like would work:
>> 
>> if (!proxy->client && read(proxy->fd_ssl, &err, 0) < 0 && errno == ENOTCONN) {
> 
> How about calling getpeername on fd_ssl? That should reliably tell you
> if the socket is connected or not. http://cr.yp.to/docs/connect.html
> suggests that read is not always a reliable test for that.

Yes, that sounds like it would work better:

if (!proxy->client && net_getpeername(proxy->fd_ssl, NULL, NULL)  < 0 && errno == ENOTCONN) {




More information about the dovecot mailing list