Changeset 4936 for pjproject


Ignore:
Timestamp:
Oct 1, 2014 6:45:02 AM (10 years ago)
Author:
ming
Message:

Fixed #1795: Assertion if ending 100rel session when invite on early state

File:
1 edited

Legend:

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

    r4713 r4936  
    376376 
    377377 
     378/* Clear all responses in the transmission list */ 
     379static void clear_all_responses(dlg_data *dd) 
     380{ 
     381    tx_data_list_t *tl; 
     382 
     383    tl = dd->uas_state->tx_data_list.next; 
     384    while (tl != &dd->uas_state->tx_data_list) { 
     385        pjsip_tx_data_dec_ref(tl->tdata); 
     386        tl = tl->next; 
     387    } 
     388    pj_list_init(&dd->uas_state->tx_data_list); 
     389} 
     390 
    378391/* 
    379392 * Notify 100rel module that the invite session has been disconnected. 
     
    389402    /* Make sure we don't have pending transmission */ 
    390403    if (dd->uas_state) { 
    391         pj_assert(!dd->uas_state->retransmit_timer.id); 
    392         pj_assert(pj_list_empty(&dd->uas_state->tx_data_list)); 
     404       /* Cancel the retransmit timer */ 
     405        if (dd->uas_state->retransmit_timer.id) { 
     406            pjsip_endpt_cancel_timer(dd->inv->dlg->endpt, 
     407                                     &dd->uas_state->retransmit_timer); 
     408            dd->uas_state->retransmit_timer.id = PJ_FALSE; 
     409        } 
     410        if (!pj_list_empty(&dd->uas_state->tx_data_list)) { 
     411            /* Clear all pending responses (drop 'em) */ 
     412            clear_all_responses(dd); 
     413        } 
    393414    } 
    394415 
     
    425446        p_method->slen = 0; 
    426447    } 
    427 } 
    428  
    429 /* Clear all responses in the transmission list */ 
    430 static void clear_all_responses(dlg_data *dd) 
    431 { 
    432     tx_data_list_t *tl; 
    433  
    434     tl = dd->uas_state->tx_data_list.next; 
    435     while (tl != &dd->uas_state->tx_data_list) { 
    436         pjsip_tx_data_dec_ref(tl->tdata); 
    437         tl = tl->next; 
    438     } 
    439     pj_list_init(&dd->uas_state->tx_data_list); 
    440448} 
    441449 
Note: See TracChangeset for help on using the changeset viewer.