Changeset 667
- Timestamp:
- 03/13/07 23:46:45 (2 years ago)
- Files:
-
- cherokee/trunk/ChangeLog (modified) (1 diff)
- cherokee/trunk/cherokee/socket.c (modified) (8 diffs)
- cherokee/trunk/configure.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cherokee/trunk/ChangeLog
r666 r667 1 2007-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 1 13 2007-03-13 Alvaro Lopez Ortega <alvaro@alobbs.com> 2 14 cherokee/trunk/cherokee/socket.c
r665 r667 407 407 408 408 switch (re) { 409 #if (GNUTLS_E_INTERRUPTED != GNUTLS_E_AGAIN) 410 case GNUTLS_E_INTERRUPTED: 411 #endif 409 412 case GNUTLS_E_AGAIN: 410 413 return ret_eagain; 411 case GNUTLS_E_INTERRUPTED: 412 return ret_error; 413 } 414 414 } 415 415 416 if (re < 0) { 416 417 PRINT_ERROR ("ERROR: Init GNUTLS: Handshake has failed: %s\n", gnutls_strerror(re)); … … 929 930 socket->status = socket_closed; 930 931 return ret_eof; 932 #if (GNUTLS_E_INTERRUPTED != GNUTLS_E_AGAIN) 931 933 case GNUTLS_E_INTERRUPTED: 934 #endif 932 935 case GNUTLS_E_AGAIN: 933 936 return ret_eagain; … … 1067 1070 switch (len) { 1068 1071 case GNUTLS_E_PUSH_ERROR: 1069 case GNUTLS_E_INTERRUPTED:1070 1072 case GNUTLS_E_INVALID_SESSION: 1071 1073 case GNUTLS_E_UNEXPECTED_PACKET_LENGTH: 1072 1074 socket->status = socket_closed; 1073 1075 return ret_eof; 1076 #if (GNUTLS_E_INTERRUPTED != GNUTLS_E_AGAIN) 1077 case GNUTLS_E_INTERRUPTED: 1078 #endif 1074 1079 case GNUTLS_E_AGAIN: 1075 1080 return ret_eagain; … … 1140 1145 #endif 1141 1146 { 1142 int re ;1147 int re = 0; 1143 1148 #ifdef _WIN32 1144 1149 int i; … … 1146 1151 1147 1152 for (i = 0, re = 0, total = 0; i < vector_len; i++) { 1153 if (vector[i].iov_len == 0) 1154 continue; 1148 1155 re = send (SOCKET_FD(socket), vector[i].iov_base, vector[i].iov_len, 0); 1149 1156 if (re < 0) 1150 1157 break; 1158 1151 1159 total += re; 1160 1161 /* if it is a partial send, then stop sending data 1162 */ 1152 1163 if (re != vector[i].iov_len) 1153 1164 break; … … 1231 1242 size_t cnt; 1232 1243 1233 for (i = 0; i < vector_len; i++ , vector++) {1244 for (i = 0; i < vector_len; i++) { 1234 1245 1235 1246 if (vector[i].iov_base == NULL || vector[i].iov_len == 0) … … 1239 1250 ret = cherokee_socket_write (socket, vector[i].iov_base, vector[i].iov_len, &cnt); 1240 1251 *pcnt_written += cnt; 1241 1242 if (ret == ret_ok )1252 1253 if (ret == ret_ok && cnt == vector[i].iov_len) 1243 1254 continue; 1244 1255 1245 /* else != ret_ok 1256 /* else != ret_ok || cnt != vector[i].iov_len 1246 1257 */ 1247 1258 if (*pcnt_written != 0) 1248 1259 return ret_ok; 1260 1249 1261 /* Nothing has been written, return error code. 1250 1262 */ … … 1602 1614 if (re < 0) { 1603 1615 switch (re) { 1616 #if (GNUTLS_E_INTERRUPTED != GNUTLS_E_AGAIN) 1617 case GNUTLS_E_INTERRUPTED: 1618 #endif 1604 1619 case GNUTLS_E_AGAIN: 1605 case GNUTLS_E_INTERRUPTED:1606 1620 break; 1607 1621 default: cherokee/trunk/configure.in
r666 r667 418 418 419 419 420 421 422 423 420 dnl 424 421 dnl Pthread