summaryrefslogtreecommitdiff
path: root/pjsip/src
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2012-02-16 05:35:25 +0000
committerBenny Prijono <bennylp@teluu.com>2012-02-16 05:35:25 +0000
commit5e23d504cd6a1da1d8bfc8365b3c4dbcd3c184f9 (patch)
tree96d6edf1be70f1bbc0709cac49dd46ee093e8d4e /pjsip/src
parent3c9b57a58e391b5b13752194c836c87aad626884 (diff)
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.
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@3952 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src')
-rw-r--r--pjsip/src/pjsip/sip_config.c4
-rw-r--r--pjsip/src/pjsip/sip_util.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/pjsip/src/pjsip/sip_config.c b/pjsip/src/pjsip/sip_config.c
index 37a66a67..ce970e8a 100644
--- a/pjsip/src/pjsip/sip_config.c
+++ b/pjsip/src/pjsip/sip_config.c
@@ -25,7 +25,9 @@ pjsip_cfg_t pjsip_sip_cfg_var =
{
/* Global settings */
{
- PJSIP_ALLOW_PORT_IN_FROMTO_HDR
+ PJSIP_ALLOW_PORT_IN_FROMTO_HDR,
+ 0,
+ PJSIP_DONT_SWITCH_TO_TCP
},
/* Transaction settings */
diff --git a/pjsip/src/pjsip/sip_util.c b/pjsip/src/pjsip/sip_util.c
index 4f82a1a6..f238f524 100644
--- a/pjsip/src/pjsip/sip_util.c
+++ b/pjsip/src/pjsip/sip_util.c
@@ -1248,14 +1248,14 @@ stateless_send_resolver_callback( pj_status_t status,
}
pj_assert(tdata->dest_info.addr.count != 0);
-#if !defined(PJSIP_DONT_SWITCH_TO_TCP) || PJSIP_DONT_SWITCH_TO_TCP==0
/* RFC 3261 section 18.1.1:
* If a request is within 200 bytes of the path MTU, or if it is larger
* than 1300 bytes and the path MTU is unknown, the request MUST be sent
* using an RFC 2914 [43] congestion controlled transport protocol, such
* as TCP.
*/
- if (tdata->msg->type == PJSIP_REQUEST_MSG &&
+ if (pjsip_cfg()->endpt.disable_tcp_switch==0 &&
+ tdata->msg->type == PJSIP_REQUEST_MSG &&
tdata->dest_info.addr.count > 0 &&
tdata->dest_info.addr.entry[0].type == PJSIP_TRANSPORT_UDP)
{
@@ -1297,7 +1297,6 @@ stateless_send_resolver_callback( pj_status_t status,
tdata->dest_info.addr.count = count * 2;
}
}
-#endif /* !PJSIP_DONT_SWITCH_TO_TCP */
/* Process the addresses. */
stateless_send_transport_cb( stateless_data, tdata, -PJ_EPENDING);