Changeset 2074

Show
Ignore:
Timestamp:
02/12/2008 02:17:40 PM (7 months ago)
Author:
jan
Message:

fixed error-msg on connection-shutdown if memory-chunks are sent
(SSL_ERROR_ZERO_RETURN).

for the file-chunks we handled it correctly already

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/network_openssl.c

    r2070 r2074  
    4646                len = SSL_read(sock->ssl, b->ptr, b->size - 1); 
    4747 
    48                 if (len < 0) { 
     48                /** 
     49                 * man SSL_read: 
     50                 * 
     51                 * >0   is success 
     52                 * 0    is connection close 
     53                 * <0   is error  
     54                 */ 
     55                if (len <= 0) { 
    4956                        int r, ssl_err; 
    5057 
     
    8289                                return NETWORK_STATUS_FATAL_ERROR; 
    8390                        case SSL_ERROR_ZERO_RETURN: 
    84                                 /* clean shutdown on the remote side */ 
    85  
    86                                 if (r == 0) { 
    87                                         /* FIXME: later */ 
    88                                 } 
    89  
    90                                 /* fall through */ 
     91                                if (len == 0) { 
     92                                        /* clean shutdown on the remote side */ 
     93                                        return NETWORK_STATUS_CONNECTION_CLOSE; 
     94                                } 
     95                                /* fall through otherwise */ 
    9196                        default: 
    9297                                while((ssl_err = ERR_get_error())) { 
     
    97102                                return NETWORK_STATUS_FATAL_ERROR; 
    98103                        } 
    99                 } else if (len == 0) { 
    100                         return NETWORK_STATUS_FATAL_ERROR; 
    101104                } else { 
    102105                        b->used += len;