Changeset 5537
- Timestamp:
- 05/28/08 01:23:41 (4 months ago)
- Files:
-
- libwired/trunk/libwired/net/wi-socket.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libwired/trunk/libwired/net/wi-socket.c
r5530 r5537 1169 1169 wi_boolean_t wi_socket_accept_tls(wi_socket_t *socket, wi_socket_tls_t *tls, wi_time_interval_t timeout) { 1170 1170 #ifdef WI_SSL 1171 SSL *ssl; 1171 SSL *ssl; 1172 wi_socket_state_t state; 1172 1173 1173 1174 ssl = SSL_new(tls->ssl_ctx); … … 1194 1195 1195 1196 if(timeout > 0.0) { 1196 if(wi_socket_wait_descriptor(socket->sd, timeout, true, false) != WI_SOCKET_READY) 1197 state = wi_socket_wait_descriptor(socket->sd, timeout, true, false); 1198 1199 if(state != WI_SOCKET_READY) { 1200 if(state == WI_SOCKET_TIMEOUT) 1201 wi_error_set_errno(ETIMEDOUT); 1202 1197 1203 goto err; 1204 } 1198 1205 } 1199 1206 … … 1356 1363 1357 1364 wi_integer_t wi_socket_write_buffer(wi_socket_t *socket, wi_time_interval_t timeout, const void *buffer, size_t length) { 1358 wi_integer_t bytes; 1365 wi_socket_state_t state; 1366 wi_integer_t bytes; 1359 1367 1360 1368 if(timeout > 0.0) { 1361 if(wi_socket_wait_descriptor(socket->sd, timeout, false, true) != WI_SOCKET_READY) 1369 state = wi_socket_wait_descriptor(socket->sd, timeout, false, true); 1370 1371 if(state != WI_SOCKET_READY) { 1372 if(state == WI_SOCKET_TIMEOUT) 1373 wi_error_set_errno(ETIMEDOUT); 1374 1362 1375 return -1; 1376 } 1363 1377 } 1364 1378 … … 1473 1487 1474 1488 wi_integer_t wi_socket_read_buffer(wi_socket_t *socket, wi_time_interval_t timeout, void *buffer, size_t length) { 1475 wi_integer_t bytes; 1489 wi_socket_state_t state; 1490 wi_integer_t bytes; 1476 1491 1477 1492 if(timeout > 0.0) { … … 1479 1494 if(!socket->ssl || (socket->ssl && SSL_pending(socket->ssl) == 0)) { 1480 1495 #endif 1481 if(wi_socket_wait_descriptor(socket->sd, timeout, true, false) != WI_SOCKET_READY) 1496 state = wi_socket_wait_descriptor(socket->sd, timeout, true, false); 1497 1498 if(state != WI_SOCKET_READY) { 1499 if(state == WI_SOCKET_TIMEOUT) 1500 wi_error_set_errno(ETIMEDOUT); 1501 1482 1502 return -1; 1503 } 1483 1504 #ifdef WI_SSL 1484 1505 }
