Changeset 6088 for pjproject


Ignore:
Timestamp:
Oct 8, 2019 8:32:53 AM (5 years ago)
Author:
riza
Message:

Fixed #2241: Update "sent-by" field of Via header on CANCEL request for proxy scenario.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_util.c

    r5733 r6088  
    11061106    PJ_UNUSED_ARG(tdata); 
    11071107    pj_assert(tdata == stateless_data->tdata); 
     1108    pj_status_t need_update_via = PJ_TRUE; 
    11081109 
    11091110    for (;;) { 
     
    12021203        } 
    12031204 
     1205        if (tdata->msg->line.req.method.id == PJSIP_CANCEL_METHOD) { 
     1206            if (via->sent_by.host.slen > 0) { 
     1207                /* Don't update Via header on a CANCEL request if the sent-by 
     1208                 * parameter is already set since it needs to match the  
     1209                 * original request. */ 
     1210                need_update_via = PJ_FALSE; 
     1211            } 
     1212        } 
     1213 
    12041214        if (via->branch_param.slen == 0) { 
    12051215            pj_str_t tmp; 
     
    12141224        } 
    12151225 
    1216         /* For CANCEL request, do not update the Via header since it needs 
    1217          * to match the original request. 
    1218          */ 
    1219         if (tdata->msg->line.req.method.id != PJSIP_CANCEL_METHOD) { 
     1226        if (need_update_via) { 
    12201227            via->transport = pj_str(stateless_data->cur_transport->type_name); 
    12211228 
Note: See TracChangeset for help on using the changeset viewer.