Changeset 2756


Ignore:
Timestamp:
Jun 8, 2009 3:30:38 PM (15 years ago)
Author:
nanang
Message:

Ticket #831: Added compile-time option to disable/prevent transport switching to TCP.

Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/sip_config.h

    r2754 r2756  
    234234 * as TCP. 
    235235 * 
     236 * Disable the behavior of automatic switching to TCP whenever UDP packet 
     237 * size exceeds the threshold defined in PJSIP_UDP_SIZE_THRESHOLD. 
     238 * 
     239 * Default is 0 (no). 
     240 */ 
     241#ifndef PJSIP_DONT_SWITCH_TO_TCP 
     242#   define PJSIP_DONT_SWITCH_TO_TCP     0 
     243#endif 
     244 
     245 
     246/** 
    236247 * This setting controls the threshold of the UDP packet, which if it's 
    237  * larger than this value the request will be sent with TCP. Default is 
    238  * 1300 bytes. 
     248 * larger than this value the request will be sent with TCP. This setting 
     249 * is useful only when PJSIP_DONT_SWITCH_TO_TCP is set to 0. 
     250 * 
     251 * Default is 1300 bytes. 
    239252 */ 
    240253#ifndef PJSIP_UDP_SIZE_THRESHOLD 
    241254#   define PJSIP_UDP_SIZE_THRESHOLD     1300 
    242255#endif 
     256 
    243257 
    244258/** 
  • pjproject/trunk/pjsip/src/pjsip/sip_util.c

    r2746 r2756  
    11911191    pj_memcpy( &stateless_data->addr, addr, sizeof(pjsip_server_addresses)); 
    11921192 
     1193#if !defined(PJSIP_DONT_SWITCH_TO_TCP) || PJSIP_DONT_SWITCH_TO_TCP==0 
    11931194    /* RFC 3261 section 18.1.1: 
    11941195     * If a request is within 200 bytes of the path MTU, or if it is larger 
     
    12351236        } 
    12361237    } 
     1238#endif /* !PJSIP_DONT_SWITCH_TO_TCP */ 
    12371239 
    12381240    /* Process the addresses. */ 
Note: See TracChangeset for help on using the changeset viewer.