Ignore:
Timestamp:
Nov 4, 2009 3:35:13 AM (14 years ago)
Author:
nanang
Message:

Misc fix (#951): Fixed possible random/unexpected pairs generated in ioqueue tcp unit test (such case was occured when test was performed using IOCP ioqueue on Vista).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pjlib-test/ioq_tcp.c

    r2394 r2983  
    758758            } 
    759759 
    760         } 
    761  
    762  
    763         // Poll until all connected 
    764         while (pending_op) { 
    765             pj_time_val timeout = {1, 0}; 
     760            // Poll until connection of this pair established 
     761            while (pending_op) { 
     762                pj_time_val timeout = {1, 0}; 
    766763 
    767764#ifdef PJ_SYMBIAN 
    768             status = pj_symbianos_poll(-1, 1000); 
     765                status = pj_symbianos_poll(-1, 1000); 
    769766#else 
    770             status = pj_ioqueue_poll(ioque, &timeout); 
     767                status = pj_ioqueue_poll(ioque, &timeout); 
    771768#endif 
    772             if (status > 0) { 
    773                 if (status > pending_op) { 
    774                     PJ_LOG(3,(THIS_FILE, 
    775                               "...error: pj_ioqueue_poll() returned %d " 
    776                               "(only expecting %d)", 
    777                               status, pending_op)); 
    778                     return -110; 
    779                 } 
    780                 pending_op -= status; 
    781  
    782                 if (pending_op == 0) { 
    783                     status = 0; 
     769                if (status > 0) { 
     770                    if (status > pending_op) { 
     771                        PJ_LOG(3,(THIS_FILE, 
     772                                  "...error: pj_ioqueue_poll() returned %d " 
     773                                  "(only expecting %d)", 
     774                                  status, pending_op)); 
     775                        return -110; 
     776                    } 
     777                    pending_op -= status; 
     778 
     779                    if (pending_op == 0) { 
     780                        status = 0; 
     781                    } 
    784782                } 
    785783            } 
Note: See TracChangeset for help on using the changeset viewer.