Ignore:
Timestamp:
Oct 4, 2007 9:48:25 AM (17 years ago)
Author:
bennylp
Message:

Ticket #390: Register session will keep transport instance so that keep-alive is sent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c

    r1458 r1472  
    8585    /* Transport selector */ 
    8686    pjsip_tpselector             tp_sel; 
     87 
     88    /* Last transport used. We acquire the transport to keep 
     89     * it open. 
     90     */ 
     91    pjsip_transport             *last_transport; 
    8792}; 
    8893 
     
    134139    } else { 
    135140        pjsip_tpselector_dec_ref(&regc->tp_sel); 
     141        if (regc->last_transport) { 
     142            pjsip_transport_dec_ref(regc->last_transport); 
     143            regc->last_transport = NULL; 
     144        } 
    136145        pjsip_endpt_release_pool(regc->endpt, regc->pool); 
    137146    } 
     
    609618    pj_assert(regc->has_tsx); 
    610619    regc->has_tsx = PJ_FALSE; 
     620 
     621    /* Add reference to the transport */ 
     622    if (tsx->transport != regc->last_transport) { 
     623        if (regc->last_transport) { 
     624            pjsip_transport_dec_ref(regc->last_transport); 
     625            regc->last_transport = NULL; 
     626        } 
     627 
     628        if (tsx->transport) { 
     629            regc->last_transport = tsx->transport; 
     630            pjsip_transport_add_ref(regc->last_transport); 
     631        } 
     632    } 
    611633 
    612634    /* Handle 401/407 challenge (even when _delete_flag is set) */ 
Note: See TracChangeset for help on using the changeset viewer.