diff options
author | Benny Prijono <bennylp@teluu.com> | 2012-04-26 09:31:00 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2012-04-26 09:31:00 +0000 |
commit | 2fd6e672f9f6698775df88ac9a16b446f214de1f (patch) | |
tree | 0064cdae1e49f1926b5aa5a7a99cad0080d304c5 /pjsip | |
parent | 0027974b3822c7f95c1787e5546481b1b73ab698 (diff) |
Re #1474: merged r4081-r4093
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4094 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/include/pjsip/sip_config.h | 8 | ||||
-rw-r--r-- | pjsip/src/pjsip/sip_transport.c | 10 | ||||
-rw-r--r-- | pjsip/src/test/regc_test.c | 2 |
3 files changed, 16 insertions, 4 deletions
diff --git a/pjsip/include/pjsip/sip_config.h b/pjsip/include/pjsip/sip_config.h index 8efc8814..6b8b328a 100644 --- a/pjsip/include/pjsip/sip_config.h +++ b/pjsip/include/pjsip/sip_config.h @@ -431,10 +431,14 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void) * side) with no usage before the transport is destroyed. Value is in * seconds. * - * Default: 30 + * Note that if the value is put lower than 33 seconds, it may cause some + * pjsip test units to fail. See the comment on the following link: + * https://trac.pjsip.org/repos/ticket/1465#comment:4 + * + * Default: 33 */ #ifndef PJSIP_TRANSPORT_IDLE_TIME -# define PJSIP_TRANSPORT_IDLE_TIME 30 +# define PJSIP_TRANSPORT_IDLE_TIME 33 #endif diff --git a/pjsip/src/pjsip/sip_transport.c b/pjsip/src/pjsip/sip_transport.c index 556868cf..2f3ceeba 100644 --- a/pjsip/src/pjsip/sip_transport.c +++ b/pjsip/src/pjsip/sip_transport.c @@ -659,6 +659,11 @@ PJ_DEF(pj_status_t) pjsip_transport_send( pjsip_transport *tr, return PJSIP_EPENDINGTX; } + /* Add reference to prevent deletion, and to cancel idle timer if + * it's running. + */ + pjsip_transport_add_ref(tr); + /* Fill in tp_info. */ tdata->tp_info.transport = tr; pj_memcpy(&tdata->tp_info.dst_addr, addr, addr_len); @@ -676,8 +681,10 @@ PJ_DEF(pj_status_t) pjsip_transport_send( pjsip_transport *tr, */ if (tr->tpmgr->on_tx_msg) { status = (*tr->tpmgr->on_tx_msg)(tr->endpt, tdata); - if (status != PJ_SUCCESS) + if (status != PJ_SUCCESS) { + pjsip_transport_dec_ref(tr); return status; + } } /* Save callback data. */ @@ -699,6 +706,7 @@ PJ_DEF(pj_status_t) pjsip_transport_send( pjsip_transport *tr, pjsip_tx_data_dec_ref(tdata); } + pjsip_transport_dec_ref(tr); return status; } diff --git a/pjsip/src/test/regc_test.c b/pjsip/src/test/regc_test.c index 1d54b290..7a5b8065 100644 --- a/pjsip/src/test/regc_test.c +++ b/pjsip/src/test/regc_test.c @@ -772,7 +772,7 @@ int regc_test(void) /* client expected results: */ /* error code have_reg expiration contact_cnt auth?*/ - { PJ_FALSE, 503, PJ_FALSE, -1, 0, PJ_FALSE} + { PJ_FALSE, 502, PJ_FALSE, -1, 0, PJ_FALSE} }, /* timeout test */ |