version 1.9, 2005/03/08 00:12:19
|
version 1.10, 2005/03/08 00:19:31
|
|
|
| |
for ( i = 0; i < n_connections; i++ ) | for ( i = 0; i < n_connections; i++ ) |
{ | { |
if ( FD_ISSET( mem->sock[i].s, &fds_recv ) ) { |
if ( ( mem->sock[i].n_recvd < n_expected ) && FD_ISSET( mem->sock[i].s, &fds_recv ) ) { |
| |
/* Receive data & check it */ | /* Receive data & check it */ |
mem->sock[i].n_recvd += recv ( mem->sock[i].s, mem->sock[i].buf + mem->sock[i].n_recvd, min ( n_expected - mem->sock[i].n_recvd, par->buflen ), 0 ); | mem->sock[i].n_recvd += recv ( mem->sock[i].s, mem->sock[i].buf + mem->sock[i].n_recvd, min ( n_expected - mem->sock[i].n_recvd, par->buflen ), 0 ); |
|
|
ok ( mem->sock[i].n_recvd <= n_expected, "select_server (%x): received too many bytes: %d\n", id, mem->sock[i].n_recvd ); | ok ( mem->sock[i].n_recvd <= n_expected, "select_server (%x): received too many bytes: %d\n", id, mem->sock[i].n_recvd ); |
} | } |
| |
if ( FD_ISSET ( mem->sock[i].s, &fds_send ) ) { |
if ( ( mem->sock[i].n_sent < n_expected ) && FD_ISSET ( mem->sock[i].s, &fds_send ) ) { |
| |
/* Echo data back */ | /* Echo data back */ |
mem->sock[i].n_sent += send ( mem->sock[i].s, mem->sock[i].buf + mem->sock[i].n_sent, min ( n_expected - mem->sock[i].n_sent, par->buflen ), 0 ); | mem->sock[i].n_sent += send ( mem->sock[i].s, mem->sock[i].buf + mem->sock[i].n_sent, min ( n_expected - mem->sock[i].n_sent, par->buflen ), 0 ); |