Changeset 667

Show
Ignore:
Timestamp:
03/13/07 23:46:45 (2 years ago)
Author:
alo
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cherokee/trunk/ChangeLog

    r666 r667  
     12007-03-13  A.D.F  <adefacc@tin.it> 
     2 
     3        * cherokee/socket.c: 
     4        - cherokee_socket_read(), cherokee_socket_write*(): 
     5          - GNUTLS_E_INTERRUPTED is used only if its value 
     6            is not equal to GNUTLS_E_AGAIN; 
     7        - cherokee_socket_writev(): 
     8          - don't increment "vector" because we use vector[i].* 
     9            not vector->*; 
     10          - micro-fix to not return ret_again if at least 1 bytes 
     11            has been sent. 
     12         
    1132007-03-13  Alvaro Lopez Ortega  <alvaro@alobbs.com> 
    214 
  • cherokee/trunk/cherokee/socket.c

    r665 r667  
    407407 
    408408        switch (re) { 
     409#if (GNUTLS_E_INTERRUPTED != GNUTLS_E_AGAIN) 
     410        case GNUTLS_E_INTERRUPTED: 
     411#endif 
    409412        case GNUTLS_E_AGAIN: 
    410413                return ret_eagain; 
    411         case GNUTLS_E_INTERRUPTED: 
    412                 return ret_error; 
    413         } 
    414          
     414        } 
     415 
    415416        if (re < 0) { 
    416417                PRINT_ERROR ("ERROR: Init GNUTLS: Handshake has failed: %s\n", gnutls_strerror(re)); 
     
    929930                                socket->status = socket_closed; 
    930931                                return ret_eof; 
     932#if (GNUTLS_E_INTERRUPTED != GNUTLS_E_AGAIN) 
    931933                        case GNUTLS_E_INTERRUPTED: 
     934#endif 
    932935                        case GNUTLS_E_AGAIN:            
    933936                                return ret_eagain; 
     
    10671070                switch (len) { 
    10681071                case GNUTLS_E_PUSH_ERROR: 
    1069                 case GNUTLS_E_INTERRUPTED:               
    10701072                case GNUTLS_E_INVALID_SESSION: 
    10711073                case GNUTLS_E_UNEXPECTED_PACKET_LENGTH: 
    10721074                        socket->status = socket_closed; 
    10731075                        return ret_eof; 
     1076#if (GNUTLS_E_INTERRUPTED != GNUTLS_E_AGAIN) 
     1077                case GNUTLS_E_INTERRUPTED:               
     1078#endif 
    10741079                case GNUTLS_E_AGAIN: 
    10751080                        return ret_eagain; 
     
    11401145#endif 
    11411146        { 
    1142                 int re
     1147                int re = 0
    11431148#ifdef _WIN32 
    11441149                int i; 
     
    11461151 
    11471152                for (i = 0, re = 0, total = 0; i < vector_len; i++) { 
     1153                        if (vector[i].iov_len == 0) 
     1154                                continue; 
    11481155                        re = send (SOCKET_FD(socket), vector[i].iov_base, vector[i].iov_len, 0); 
    11491156                        if (re < 0) 
    11501157                                break; 
     1158 
    11511159                        total += re; 
     1160 
     1161                        /* if it is a partial send, then stop sending data 
     1162                         */ 
    11521163                        if (re != vector[i].iov_len) 
    11531164                                break; 
     
    12311242                size_t cnt; 
    12321243                 
    1233                 for (i = 0; i < vector_len; i++, vector++) { 
     1244                for (i = 0; i < vector_len; i++) { 
    12341245 
    12351246                        if (vector[i].iov_base == NULL || vector[i].iov_len == 0) 
     
    12391250                        ret = cherokee_socket_write (socket, vector[i].iov_base, vector[i].iov_len, &cnt); 
    12401251                        *pcnt_written += cnt; 
    1241                          
    1242                         if (ret == ret_ok
     1252 
     1253                        if (ret == ret_ok && cnt == vector[i].iov_len
    12431254                                continue; 
    12441255 
    1245                         /* else != ret_ok 
     1256                        /* else != ret_ok || cnt != vector[i].iov_len 
    12461257                         */ 
    12471258                        if (*pcnt_written != 0) 
    12481259                                return ret_ok; 
     1260 
    12491261                        /* Nothing has been written, return error code. 
    12501262                         */ 
     
    16021614                if (re < 0) { 
    16031615                        switch (re) { 
     1616#if (GNUTLS_E_INTERRUPTED != GNUTLS_E_AGAIN) 
     1617                        case GNUTLS_E_INTERRUPTED: 
     1618#endif 
    16041619                        case GNUTLS_E_AGAIN: 
    1605                         case GNUTLS_E_INTERRUPTED: 
    16061620                                break; 
    16071621                        default: 
  • cherokee/trunk/configure.in

    r666 r667  
    418418 
    419419 
    420  
    421  
    422  
    423420dnl 
    424421dnl Pthread