Changeset 1467


Ignore:
Timestamp:
Oct 1, 2007 12:22:52 PM (17 years ago)
Author:
bennylp
Message:

Related to ticket #385: bug in 100rel causing 2xx response to be queued indefinitely when UAS previously sent 1xx response with SDP

File:
1 edited

Legend:

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

    r1464 r1467  
    102102        pj_int32_t       cseq; 
    103103        pj_uint32_t      rseq;  /* Initialized to -1 */ 
    104         pj_bool_t        has_sdp; 
    105104        tx_data_list_t   tx_data_list; 
    106105        unsigned         retransmit_count; 
     
    616615} 
    617616 
     617/* Check if pending response has SDP */ 
     618static pj_bool_t has_sdp(dlg_data *dd) 
     619{ 
     620        tx_data_list_t *tl; 
     621 
     622        tl = dd->uas_state->tx_data_list.next; 
     623        while (tl != &dd->uas_state->tx_data_list) { 
     624                if (tl->tdata->msg->body) 
     625                        return PJ_TRUE; 
     626                tl = tl->next; 
     627        } 
     628 
     629        return PJ_FALSE; 
     630} 
     631 
     632 
     633/* Send response reliably */ 
    618634PJ_DEF(pj_status_t) pjsip_100rel_tx_response(pjsip_inv_session *inv, 
    619635                                             pjsip_tx_data *tdata) 
     
    679695                */ 
    680696 
    681                 if (dd->uas_state && dd->uas_state->has_sdp) { 
     697                if (dd->uas_state && has_sdp(dd)) { 
    682698                        /* Yes we have transmitted 1xx with SDP reliably. 
    683699                         * In this case, must queue the 2xx response. 
     
    821837                } 
    822838 
    823                 /* Update SDP flag. Need to call this after the response 
    824                  * is scheduled for transmission. 
    825                  */ 
    826                 dd->uas_state->has_sdp |= (tdata->msg->body != NULL); 
    827839        } 
    828840 
Note: See TracChangeset for help on using the changeset viewer.