- Timestamp:
- Apr 11, 2012 9:41:25 AM (13 years ago)
- Location:
- pjproject/branches/1.x/pjsip
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/1.x/pjsip/include/pjsip-ua/sip_regc.h
r3553 r4037 266 266 const pjsip_tpselector *sel); 267 267 268 /** 269 * Release the reference to current transport being used by the regc, if any. 270 * The regc keeps the reference to the last transport being used in order 271 * to prevent it from being destroyed. In some situation however, such as 272 * when the transport is disconnected, it is necessary to instruct the 273 * regc to release this reference so that the transport can be destroyed. 274 * See https://trac.pjsip.org/repos/ticket/1481 for background info. 275 * 276 * @param regc The client registration instance. 277 * 278 * @return PJ_SUCCESS on success, or the appropriate error code. 279 */ 280 PJ_DECL(pj_status_t) pjsip_regc_release_transport(pjsip_regc *regc); 268 281 269 282 /** -
pjproject/branches/1.x/pjsip/src/pjsip-ua/sip_reg.c
r3553 r4037 441 441 } 442 442 443 /* Release transport */ 444 PJ_DEF(pj_status_t) pjsip_regc_release_transport(pjsip_regc *regc) 445 { 446 PJ_ASSERT_RETURN(regc, PJ_EINVAL); 447 if (regc->last_transport) { 448 pjsip_transport_dec_ref(regc->last_transport); 449 regc->last_transport = NULL; 450 } 451 return PJ_SUCCESS; 452 } 453 443 454 444 455 PJ_DEF(pj_status_t) pjsip_regc_add_headers( pjsip_regc *regc, … … 1270 1281 1271 1282 /* Get last transport used and add reference to it */ 1272 if (tdata->tp_info.transport != regc->last_transport) { 1283 if (tdata->tp_info.transport != regc->last_transport && 1284 status==PJ_SUCCESS) 1285 { 1273 1286 if (regc->last_transport) { 1274 1287 pjsip_transport_dec_ref(regc->last_transport); -
pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_acc.c
r4033 r4037 2822 2822 } 2823 2823 2824 /* Destroy regc to release transport immediately */ 2824 /* Release regc transport immediately 2825 * See https://trac.pjsip.org/repos/ticket/1481 2826 */ 2825 2827 if (pjsua_var.acc[i].regc) { 2826 pjsip_regc_destroy(pjsua_var.acc[i].regc); 2827 } 2828 pjsua_var.acc[i].regc = NULL; 2828 pjsip_regc_release_transport(pjsua_var.acc[i].regc); 2829 } 2829 2830 2830 2831 /* Schedule reregistration for this account */
Note: See TracChangeset
for help on using the changeset viewer.