Changeset 2077

Show
Ignore:
Timestamp:
02/12/2008 08:44:48 PM (5 months ago)
Author:
jan
Message:

store the original errno of SSL_read() in case of a syscall error

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/network_openssl.c

    r2075 r2077  
    5757                        int r, ssl_err; 
    5858 
    59                         oerrno = errno; 
     59                        oerrno = errno; /* store the errno for SSL_ERROR_SYSCALL */ 
    6060 
    6161                        switch ((r = SSL_get_error(sock->ssl, len))) { 
     
    8181                                } 
    8282 
    83                                 switch(errno) { 
    84                                 case EPIPE: 
    85                                 case ECONNRESET: 
     83                                if (len == 0) { 
    8684                                        return NETWORK_STATUS_CONNECTION_CLOSE; 
    87                                 default: 
    88                                         ERROR("last-errno: (%d) %s", oerrno, strerror(oerrno)); 
    89                                         break; 
     85                                } else { 
     86                                        switch(oerrno) { 
     87                                        case EPIPE: 
     88                                        case ECONNRESET: 
     89                                                return NETWORK_STATUS_CONNECTION_CLOSE; 
     90                                        default: 
     91                                                ERROR("last-errno: (%d) %s", oerrno, strerror(oerrno)); 
     92                                                break; 
     93                                        } 
    9094                                } 
    9195