Changeset 3952


Ignore:
Timestamp:
Feb 16, 2012 5:35:25 AM (13 years ago)
Author:
bennylp
Message:

Allow run-time control of automatic switching to TCP when request is larger than 1300 (the PJSIP_DONT_SWITCH_TO_TCP compile time setting) via pjsip_cfg()->endpt.disable_tcp_switch setting. Thanks Johan Lantz for the suggestion.

Location:
pjproject/branches/1.x/pjsip
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjsip/include/pjsip/sip_config.h

    r3586 r3952  
    8282         */ 
    8383        pj_bool_t disable_rport; 
     84 
     85        /** 
     86         * Disable automatic switching from UDP to TCP if outgoing request 
     87         * is greater than 1300 bytes. See PJSIP_DONT_SWITCH_TO_TCP. 
     88         */ 
     89        pj_bool_t disable_tcp_switch; 
     90 
    8491    } endpt; 
    8592 
     
    252259 * size exceeds the threshold defined in PJSIP_UDP_SIZE_THRESHOLD. 
    253260 * 
     261 * This option can also be controlled at run-time by the \a disable_tcp_switch 
     262 * setting in pjsip_cfg_t. 
     263 * 
    254264 * Default is 0 (no). 
    255265 */ 
  • pjproject/branches/1.x/pjsip/src/pjsip/sip_config.c

    r3553 r3952  
    2626    /* Global settings */ 
    2727    { 
    28        PJSIP_ALLOW_PORT_IN_FROMTO_HDR 
     28       PJSIP_ALLOW_PORT_IN_FROMTO_HDR, 
     29       0, 
     30       PJSIP_DONT_SWITCH_TO_TCP 
    2931    }, 
    3032 
  • pjproject/branches/1.x/pjsip/src/pjsip/sip_util.c

    r3832 r3952  
    12491249    pj_assert(tdata->dest_info.addr.count != 0); 
    12501250 
    1251 #if !defined(PJSIP_DONT_SWITCH_TO_TCP) || PJSIP_DONT_SWITCH_TO_TCP==0 
    12521251    /* RFC 3261 section 18.1.1: 
    12531252     * If a request is within 200 bytes of the path MTU, or if it is larger 
     
    12561255     * as TCP. 
    12571256     */ 
    1258     if (tdata->msg->type == PJSIP_REQUEST_MSG && 
     1257    if (pjsip_cfg()->endpt.disable_tcp_switch==0 && 
     1258        tdata->msg->type == PJSIP_REQUEST_MSG && 
    12591259        tdata->dest_info.addr.count > 0 &&  
    12601260        tdata->dest_info.addr.entry[0].type == PJSIP_TRANSPORT_UDP) 
     
    12981298        } 
    12991299    } 
    1300 #endif /* !PJSIP_DONT_SWITCH_TO_TCP */ 
    13011300 
    13021301    /* Process the addresses. */ 
Note: See TracChangeset for help on using the changeset viewer.