Changeset 3316


Ignore:
Timestamp:
Sep 22, 2010 1:11:11 PM (13 years ago)
Author:
ming
Message:

Fixed #1130
Since the problem may not be iOS4 specific, a general approach is adopted to fix the problem.

Location:
pjproject/trunk/pjlib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/include/pj/config.h

    r3182 r3316  
    505505#ifndef PJ_MAX_HOSTNAME 
    506506#  define PJ_MAX_HOSTNAME           (128) 
     507#endif 
     508 
     509/** 
     510 * Maximum consecutive identical error for accept() operation before 
     511 * activesock stops calling the next ioqueue accept. 
     512 * 
     513 * Default: 50 
     514 */ 
     515#ifndef PJ_ACTIVESOCK_MAX_CONSECUTIVE_ACCEPT_ERROR 
     516#   define PJ_ACTIVESOCK_MAX_CONSECUTIVE_ACCEPT_ERROR 50 
    507517#endif 
    508518 
  • pjproject/trunk/pjlib/src/pj/activesock.c

    r3299 r3316  
    8585#endif 
    8686     
     87    unsigned             err_counter; 
     88    pj_status_t          last_err; 
     89 
    8790    struct send_data     send_data; 
    8891 
     
    791794 
    792795    do { 
     796        if (status == asock->last_err && status != PJ_SUCCESS) { 
     797            asock->err_counter++; 
     798            if (asock->err_counter >= PJ_ACTIVESOCK_MAX_CONSECUTIVE_ACCEPT_ERROR) { 
     799                PJ_LOG(3, ("", "Received %d consecutive errors: %d for the accept()" 
     800                               " operation, stopping further ioqueue accepts.", 
     801                               asock->err_counter, asock->last_err)); 
     802                return; 
     803            } 
     804        } else { 
     805            asock->err_counter = 0; 
     806            asock->last_err = status; 
     807        } 
     808 
    793809        if (status==PJ_SUCCESS && asock->cb.on_accept_complete) { 
    794810            pj_bool_t ret; 
Note: See TracChangeset for help on using the changeset viewer.