(file) Return to sock.c CVS log (file) (dir) Up to [RizwankCVS] / wine4 / wine / dlls / winsock / tests

Diff for /wine4/wine/dlls/winsock/tests/sock.c between version 1.8 and 1.11

version 1.8, 2005/03/08 00:10:38 version 1.11, 2005/03/08 00:25:02
Line 383 
Line 383 
     test_params *gen = par->general;     test_params *gen = par->general;
     server_memory *mem;     server_memory *mem;
     int n_expected = gen->n_chunks * gen->chunk_size, tmp, i,     int n_expected = gen->n_chunks * gen->chunk_size, tmp, i,
         id = GetCurrentThreadId(), n_connections = 0;          id = GetCurrentThreadId(), n_connections = 0, n_sent, n_recvd;
     char *p;     char *p;
     struct timeval zerotime = {0,0};     struct timeval zerotime = {0,0};
     fd_set fds_recv, fds_send, fds_openrecv, fds_opensend;     fd_set fds_recv, fds_send, fds_openrecv, fds_opensend;
Line 437 
Line 437 
  
         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 );                  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 ( n_recvd != SOCKET_ERROR, "select_server (%x): error in recv(): %d\n", id, WSAGetLastError() );
                   mem->sock[i].n_recvd += n_recvd;
  
                 if ( mem->sock[i].n_recvd == n_expected ) {                 if ( mem->sock[i].n_recvd == n_expected ) {
                     p = test_buffer ( mem->sock[i].buf, gen->chunk_size, gen->n_chunks );                     p = test_buffer ( mem->sock[i].buf, gen->chunk_size, gen->n_chunks );
Line 451 
Line 453 
                 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 );                  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 );
                   ok ( n_sent != SOCKET_ERROR, "select_server (%x): error in send(): %d\n", id, WSAGetLastError() );
                   mem->sock[i].n_sent += n_sent;
  
                 if ( mem->sock[i].n_sent == n_expected ) {                 if ( mem->sock[i].n_sent == n_expected ) {
                     FD_CLR ( mem->sock[i].s, &fds_opensend );                     FD_CLR ( mem->sock[i].s, &fds_opensend );
Line 466 
Line 470 
  
         /* check if all clients are done */         /* check if all clients are done */
         if ( ( fds_opensend.fd_count == 0 )         if ( ( fds_opensend.fd_count == 0 )
               && ( fds_openrecv.fd_count == 1 ) /* initial socket that accepts clients */
             && ( n_connections  == min ( gen->n_clients, MAX_CLIENTS ) ) ) {             && ( n_connections  == min ( gen->n_clients, MAX_CLIENTS ) ) ) {
             break;             break;
         }         }


Legend:
Removed from v.1.8  
changed lines
  Added in v.1.11

Rizwan Kassim
Powered by
ViewCVS 0.9.2