Changeset 4571
- Timestamp:
- 02/10/07 01:50:36 (1 year ago)
- Files:
-
- trackerd/trunk/trackerd/clients.c (modified) (2 diffs)
- trackerd/trunk/trackerd/commands.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trackerd/trunk/trackerd/clients.c
r4407 r4571 65 65 66 66 wt_client_t * wt_client_init_with_socket(wt_client_t *client, wi_socket_t *socket) { 67 client->buffer_size = WT_CLIENT_BUFFER_INITIAL_SIZE;68 client->buffer = wi_malloc(client->buffer_size);69 67 client->socket = wi_retain(socket); 70 68 client->state = WT_CLIENT_STATE_CONNECTED; … … 83 81 wi_release(client->ip); 84 82 wi_release(client->version); 85 86 wi_free(client->buffer);87 83 } 88 84 trackerd/trunk/trackerd/commands.c
r4570 r4571 91 91 92 92 while(client->state <= WT_CLIENT_STATE_SAID_HELLO) { 93 if(client->buffer_offset == 0) { 94 do { 95 state = wi_socket_wait(client->socket, 0.1); 96 } while(state == WI_SOCKET_TIMEOUT && client->state <= WT_CLIENT_STATE_SAID_HELLO); 97 98 if(client->state > WT_CLIENT_STATE_SAID_HELLO) { 99 /* invalid state */ 93 do { 94 state = wi_socket_wait(client->socket, 0.1); 95 } while(state == WI_SOCKET_TIMEOUT && client->state <= WT_CLIENT_STATE_SAID_HELLO); 96 97 if(client->state > WT_CLIENT_STATE_SAID_HELLO) { 98 /* invalid state */ 99 break; 100 } 101 102 if(state == WI_SOCKET_ERROR) { 103 if(wi_error_code() == EINTR) { 104 /* got a signal */ 105 continue; 106 } else { 107 /* error in TCP communication */ 108 wi_log_err(WI_STR("Could not read from %@: %m"), client->ip); 109 100 110 break; 101 }102 103 if(state == WI_SOCKET_ERROR) {104 if(wi_error_code() == EINTR) {105 /* got a signal */106 continue;107 } else {108 /* error in TCP communication */109 wi_log_err(WI_STR("Could not read from %@: %m"), client->ip);110 111 break;112 }113 111 } 114 112 }
