29 Nov
                
                    2012
                
            
            
                29 Nov
                
                '12
                
            
            
            
        
    
                9:43 p.m.
            
        On 29.11.2012, at 17.42, Erik A Johnson wrote:
No, the test to bug out doesn't work because net_geterror(proxy->fd_ssl) returns 0 in the statement
if (!proxy->client_proxy && net_geterror(proxy->fd_ssl) == ENOTCONN) {
However, errno is indeed ENOTCONN. Changing the test to
if (!proxy->client_proxy && errno == ENOTCONN) {
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) {