Ignore:
Timestamp:
Feb 4, 2014 10:13:56 AM (10 years ago)
Author:
bennylp
Message:

Misc (re #1630): Fixing warnings about variable set but not used with recent gcc

File:
1 edited

Legend:

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

    r4208 r4728  
    11/* $Id$ */ 
    2 /*  
     2/* 
    33 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) 
    44 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> 
     
    1616 * You should have received a copy of the GNU General Public License 
    1717 * along with this program; if not, write to the Free Software 
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
     18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    1919 */ 
    2020#include <pjsip/sip_dialog.h> 
     
    7474        return PJ_EINVALIDOP; 
    7575 
    76     pool = pjsip_endpt_create_pool(endpt, "dlg%p",  
    77                                    PJSIP_POOL_LEN_DIALOG,  
     76    pool = pjsip_endpt_create_pool(endpt, "dlg%p", 
     77                                   PJSIP_POOL_LEN_DIALOG, 
    7878                                   PJSIP_POOL_INC_DIALOG); 
    7979    if (!pool) 
     
    195195    dlg->local.info = pjsip_from_hdr_create(dlg->pool); 
    196196    pj_strdup_with_null(dlg->pool, &dlg->local.info_str, local_uri); 
    197     dlg->local.info->uri = pjsip_parse_uri(dlg->pool,  
    198                                            dlg->local.info_str.ptr,  
     197    dlg->local.info->uri = pjsip_parse_uri(dlg->pool, 
     198                                           dlg->local.info_str.ptr, 
    199199                                           dlg->local.info_str.slen, 0); 
    200200    if (!dlg->local.info->uri) { 
     
    215215 
    216216    /* Init local contact. */ 
    217     pj_strdup_with_null(dlg->pool, &tmp,  
     217    pj_strdup_with_null(dlg->pool, &tmp, 
    218218                        local_contact ? local_contact : local_uri); 
    219219    dlg->local.contact = (pjsip_contact_hdr*) 
    220                          pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp.ptr,  
     220                         pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp.ptr, 
    221221                                         tmp.slen, NULL); 
    222222    if (!dlg->local.contact) { 
     
    228228    dlg->remote.info = pjsip_to_hdr_create(dlg->pool); 
    229229    pj_strdup_with_null(dlg->pool, &dlg->remote.info_str, remote_uri); 
    230     dlg->remote.info->uri = pjsip_parse_uri(dlg->pool,  
    231                                             dlg->remote.info_str.ptr,  
     230    dlg->remote.info->uri = pjsip_parse_uri(dlg->pool, 
     231                                            dlg->remote.info_str.ptr, 
    232232                                            dlg->remote.info_str.slen, 0); 
    233233    if (!dlg->remote.info->uri) { 
     
    240240        PJSIP_URI_SCHEME_IS_SIPS(dlg->remote.info->uri)) 
    241241    { 
    242         pjsip_sip_uri *sip_uri = (pjsip_sip_uri *)  
     242        pjsip_sip_uri *sip_uri = (pjsip_sip_uri *) 
    243243                                 pjsip_uri_get_uri(dlg->remote.info->uri); 
    244244        if (!pj_list_empty(&sip_uri->header_param)) { 
     
    249249 
    250250            /* Print URI */ 
    251             tmp.ptr = (char*) pj_pool_alloc(dlg->pool,  
     251            tmp.ptr = (char*) pj_pool_alloc(dlg->pool, 
    252252                                            dlg->remote.info_str.slen); 
    253253            tmp.slen = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, 
    254                                        sip_uri, tmp.ptr,  
     254                                       sip_uri, tmp.ptr, 
    255255                                       dlg->remote.info_str.slen); 
    256256 
     
    283283 
    284284    /* Init client authentication session. */ 
    285     status = pjsip_auth_clt_init(&dlg->auth_sess, dlg->endpt,  
     285    status = pjsip_auth_clt_init(&dlg->auth_sess, dlg->endpt, 
    286286                                 dlg->pool, 0); 
    287287    if (status != PJ_SUCCESS) 
     
    333333                     PJSIP_ENOTREQUESTMSG); 
    334334 
    335     /* Request must not have To tag.  
     335    /* Request must not have To tag. 
    336336     * This should have been checked in the user agent (or application?). 
    337337     */ 
    338338    PJ_ASSERT_RETURN(rdata->msg_info.to->tag.slen == 0, PJ_EINVALIDOP); 
    339                       
     339 
    340340    /* The request must be a dialog establishing request. */ 
    341341    PJ_ASSERT_RETURN( 
     
    385385    /* TODO: 
    386386     *  Section 12.1.1, paragraph about using SIPS URI in Contact. 
    387      *  If the request that initiated the dialog contained a SIPS URI  
    388      *  in the Request-URI or in the top Record-Route header field value,  
    389      *  if there was any, or the Contact header field if there was no  
     387     *  If the request that initiated the dialog contained a SIPS URI 
     388     *  in the Request-URI or in the top Record-Route header field value, 
     389     *  if there was any, or the Contact header field if there was no 
    390390     *  Record-Route header field, the Contact header field in the response 
    391391     *  MUST be a SIPS URI. 
     
    396396        pj_strdup_with_null(dlg->pool, &tmp, contact); 
    397397        dlg->local.contact = (pjsip_contact_hdr*) 
    398                              pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp.ptr,  
     398                             pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp.ptr, 
    399399                                             tmp.slen, NULL); 
    400400        if (!dlg->local.contact) { 
     
    409409 
    410410    /* Init remote info from the From header. */ 
    411     dlg->remote.info = (pjsip_fromto_hdr*)  
     411    dlg->remote.info = (pjsip_fromto_hdr*) 
    412412                       pjsip_hdr_clone(dlg->pool, rdata->msg_info.from); 
    413413    pjsip_fromto_hdr_set_to(dlg->remote.info); 
     
    426426 
    427427 
    428     /* Init remote's contact from Contact header.  
     428    /* Init remote's contact from Contact header. 
    429429     * Iterate the Contact URI until we find sip: or sips: scheme. 
    430430     */ 
     
    452452    } 
    453453 
    454     dlg->remote.contact = (pjsip_contact_hdr*)  
     454    dlg->remote.contact = (pjsip_contact_hdr*) 
    455455                          pjsip_hdr_clone(dlg->pool, (pjsip_hdr*)contact_hdr); 
    456456 
     
    464464    dlg->role = PJSIP_ROLE_UAS; 
    465465 
    466     /* Secure?  
     466    /* Secure? 
    467467     *  RFC 3261 Section 12.1.1: 
    468      *  If the request arrived over TLS, and the Request-URI contained a  
     468     *  If the request arrived over TLS, and the Request-URI contained a 
    469469     *  SIPS URI, the 'secure' flag is set to TRUE. 
    470470     */ 
     
    473473 
    474474    /* Call-ID */ 
    475     dlg->call_id = (pjsip_cid_hdr*)  
     475    dlg->call_id = (pjsip_cid_hdr*) 
    476476                   pjsip_hdr_clone(dlg->pool, rdata->msg_info.cid); 
    477477 
    478     /* Route set.  
     478    /* Route set. 
    479479     *  RFC 3261 Section 12.1.1: 
    480      *  The route set MUST be set to the list of URIs in the Record-Route  
    481      *  header field from the request, taken in order and preserving all URI  
     480     *  The route set MUST be set to the list of URIs in the Record-Route 
     481     *  header field from the request, taken in order and preserving all URI 
    482482     *  parameters. If no Record-Route header field is present in the request, 
    483483     * the route set MUST be set to the empty set. 
     
    499499        if (rr == (void*)&rdata->msg_info.msg->hdr) 
    500500            break; 
    501         rr = (pjsip_route_hdr*) pjsip_msg_find_hdr(rdata->msg_info.msg,  
     501        rr = (pjsip_route_hdr*) pjsip_msg_find_hdr(rdata->msg_info.msg, 
    502502                                                   PJSIP_H_RECORD_ROUTE, rr); 
    503503    } 
     
    621621    /* Check arguments. */ 
    622622    PJ_ASSERT_RETURN(first_dlg && rdata && new_dlg, PJ_EINVAL); 
    623      
     623 
    624624    /* rdata must be response message. */ 
    625625    PJ_ASSERT_RETURN(msg->type == PJSIP_RESPONSE_MSG, 
     
    649649 
    650650    /* Clone local info. */ 
    651     dlg->local.info = (pjsip_fromto_hdr*)  
     651    dlg->local.info = (pjsip_fromto_hdr*) 
    652652                      pjsip_hdr_clone(dlg->pool, first_dlg->local.info); 
    653653 
     
    661661 
    662662    /* Clone local Contact. */ 
    663     dlg->local.contact = (pjsip_contact_hdr*)  
     663    dlg->local.contact = (pjsip_contact_hdr*) 
    664664                         pjsip_hdr_clone(dlg->pool, first_dlg->local.contact); 
    665665 
    666666    /* Clone remote info. */ 
    667     dlg->remote.info = (pjsip_fromto_hdr*)  
     667    dlg->remote.info = (pjsip_fromto_hdr*) 
    668668                       pjsip_hdr_clone(dlg->pool, first_dlg->remote.info); 
    669669 
     
    690690 
    691691    /* Clone Call-ID header. */ 
    692     dlg->call_id = (pjsip_cid_hdr*)  
     692    dlg->call_id = (pjsip_cid_hdr*) 
    693693                   pjsip_hdr_clone(dlg->pool, first_dlg->call_id); 
    694694 
     
    708708 
    709709    /* Clone client authentication session. */ 
    710     status = pjsip_auth_clt_clone(dlg->pool, &dlg->auth_sess,  
     710    status = pjsip_auth_clt_clone(dlg->pool, &dlg->auth_sess, 
    711711                                  &first_dlg->auth_sess); 
    712712    if (status != PJ_SUCCESS) 
     
    842842PJ_DEF(void) pjsip_dlg_inc_lock(pjsip_dialog *dlg) 
    843843{ 
    844     PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_inc_lock(), sess_count=%d",  
     844    PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_inc_lock(), sess_count=%d", 
    845845              dlg->sess_count)); 
    846846 
     
    848848    dlg->sess_count++; 
    849849 
    850     PJ_LOG(6,(dlg->obj_name, "Leaving pjsip_dlg_inc_lock(), sess_count=%d",  
     850    PJ_LOG(6,(dlg->obj_name, "Leaving pjsip_dlg_inc_lock(), sess_count=%d", 
    851851              dlg->sess_count)); 
    852852} 
     
    859859    pj_status_t status; 
    860860 
    861     PJ_LOG(6,(dlg->obj_name,"Entering pjsip_dlg_try_inc_lock(), sess_count=%d",  
     861    PJ_LOG(6,(dlg->obj_name,"Entering pjsip_dlg_try_inc_lock(), sess_count=%d", 
    862862              dlg->sess_count)); 
    863863 
     
    870870    dlg->sess_count++; 
    871871 
    872     PJ_LOG(6,(dlg->obj_name, "Leaving pjsip_dlg_try_inc_lock(), sess_count=%d",  
     872    PJ_LOG(6,(dlg->obj_name, "Leaving pjsip_dlg_try_inc_lock(), sess_count=%d", 
    873873              dlg->sess_count)); 
    874874 
     
    885885    PJ_ASSERT_ON_FAIL(dlg!=NULL, return); 
    886886 
    887     PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_dec_lock(), sess_count=%d",  
     887    PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_dec_lock(), sess_count=%d", 
    888888              dlg->sess_count)); 
    889889 
     
    960960    PJ_ASSERT_RETURN(dlg->usage_cnt < PJSIP_MAX_MODULE, PJ_EBUG); 
    961961 
    962     PJ_LOG(5,(dlg->obj_name,  
     962    PJ_LOG(5,(dlg->obj_name, 
    963963              "Module %.*s added as dialog usage, data=%p", 
    964964              (int)mod->name.slen, mod->name.ptr, mod_data)); 
     
    977977             * So return PJ_SUCCESS here. 
    978978             */ 
    979             PJ_LOG(4,(dlg->obj_name,  
     979            PJ_LOG(4,(dlg->obj_name, 
    980980                      "Module %.*s already registered as dialog usage, " 
    981981                      "updating the data %p", 
     
    10001000    pj_array_insert(dlg->usage, sizeof(dlg->usage[0]), dlg->usage_cnt, 
    10011001                    index, &mod); 
    1002      
     1002 
    10031003    /* Set module data. */ 
    10041004    dlg->mod_data[mod->id] = mod_data; 
     
    10141014 
    10151015/* 
    1016  * Attach module specific data to the dialog. Application can also set  
     1016 * Attach module specific data to the dialog. Application can also set 
    10171017 * the value directly by accessing dlg->mod_data[module_id]. 
    10181018 */ 
     
    10441044/* 
    10451045 * Create a new request within dialog (i.e. after the dialog session has been 
    1046  * established). The construction of such requests follows the rule in  
     1046 * established). The construction of such requests follows the rule in 
    10471047 * RFC3261 section 12.2.1. 
    10481048 */ 
     
    10581058 
    10591059    /* Contact Header field. 
    1060      * Contact can only be present in requests that establish dialog (in the  
     1060     * Contact can only be present in requests that establish dialog (in the 
    10611061     * core SIP spec, only INVITE). 
    10621062     */ 
     
    10831083        return status; 
    10841084 
    1085     /* Just copy dialog route-set to Route header.  
     1085    /* Just copy dialog route-set to Route header. 
    10861086     * The transaction will do the processing as specified in Section 12.2.1 
    10871087     * of RFC 3261 in function tsx_process_route() in sip_transaction.c. 
     
    11931193     */ 
    11941194    if (msg->line.req.method.id != PJSIP_CANCEL_METHOD && 
    1195         msg->line.req.method.id != PJSIP_ACK_METHOD)  
     1195        msg->line.req.method.id != PJSIP_ACK_METHOD) 
    11961196    { 
    11971197        pjsip_cseq_hdr *ch; 
    1198          
     1198 
    11991199        ch = PJSIP_MSG_CSEQ_HDR(msg); 
    12001200        PJ_ASSERT_RETURN(ch!=NULL, PJ_EBUG); 
     
    12451245 
    12461246        /* Send request */ 
    1247         status = pjsip_endpt_send_request_stateless(dlg->endpt, tdata,  
     1247        status = pjsip_endpt_send_request_stateless(dlg->endpt, tdata, 
    12481248                                                    NULL, NULL); 
    12491249        if (status != PJ_SUCCESS) 
     
    12601260    /* Unlock dialog, may destroy dialog. */ 
    12611261    pjsip_dlg_dec_lock(dlg); 
    1262     
     1262 
    12631263    /* Whatever happen delete the message. */ 
    12641264    pjsip_tx_data_dec_ref( tdata ); 
     
    12871287        /* Add Contact header for 1xx, 2xx, 3xx and 485 response. */ 
    12881288        if (st_class==2 || st_class==3 || (st_class==1 && st_code != 100) || 
    1289             st_code==485)  
     1289            st_code==485) 
    12901290        { 
    12911291            /* Add contact header only if one is not present. */ 
    12921292            if (pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT, NULL) == 0 && 
    1293                 pjsip_msg_find_hdr_by_name(tdata->msg, &HCONTACT, NULL) == 0)  
     1293                pjsip_msg_find_hdr_by_name(tdata->msg, &HCONTACT, NULL) == 0) 
    12941294            { 
    1295                 hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool,  
     1295                hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, 
    12961296                                                   dlg->local.contact); 
    12971297                pjsip_msg_add_hdr(tdata->msg, hdr); 
     
    13021302        if ((((st_code/10==18 || st_class==2) && dlg->add_allow) 
    13031303             || st_code==405) && 
    1304             pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ALLOW, NULL)==NULL)  
     1304            pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ALLOW, NULL)==NULL) 
    13051305        { 
    13061306            c_hdr = pjsip_endpt_get_capability(dlg->endpt, 
     
    13131313 
    13141314        /* Add Supported header in 2xx response. */ 
    1315         if (st_class==2 &&  
    1316             pjsip_msg_find_hdr(tdata->msg, PJSIP_H_SUPPORTED, NULL)==NULL)  
     1315        if (st_class==2 && 
     1316            pjsip_msg_find_hdr(tdata->msg, PJSIP_H_SUPPORTED, NULL)==NULL) 
    13171317        { 
    13181318            c_hdr = pjsip_endpt_get_capability(dlg->endpt, 
     
    14011401    } 
    14021402 
    1403     /* Remove existing Contact header (without this, when dialog sent  
     1403    /* Remove existing Contact header (without this, when dialog sent 
    14041404     * 180 and then 302, the Contact in 302 will not get updated). 
    14051405     */ 
     
    14461446              pjsip_tx_data_get_info(tdata))); 
    14471447 
    1448     /* Check that transaction method and cseq match the response.  
     1448    /* Check that transaction method and cseq match the response. 
    14491449     * This operation is sloooww (search CSeq header twice), that's why 
    14501450     * we only do it in debug mode. 
     
    14521452#if defined(PJ_DEBUG) && PJ_DEBUG!=0 
    14531453    PJ_ASSERT_RETURN( PJSIP_MSG_CSEQ_HDR(tdata->msg)->cseq == tsx->cseq && 
    1454                       pjsip_method_cmp(&PJSIP_MSG_CSEQ_HDR(tdata->msg)->method,  
     1454                      pjsip_method_cmp(&PJSIP_MSG_CSEQ_HDR(tdata->msg)->method, 
    14551455                                       &tsx->method)==0, 
    14561456                      PJ_EINVALIDOP); 
     
    14781478    status = pjsip_tsx_send_msg(tsx, tdata); 
    14791479 
    1480     /* This function must decrement transmit data request counter  
     1480    /* This function must decrement transmit data request counter 
    14811481     * regardless of the operation status. The transaction only 
    14821482     * decrements the counter if the operation is successful. 
     
    15631563    if (rdata->msg_info.cseq->cseq <= dlg->remote.cseq && 
    15641564        rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD && 
    1565         rdata->msg_info.msg->line.req.method.id != PJSIP_CANCEL_METHOD)  
     1565        rdata->msg_info.msg->line.req.method.id != PJSIP_CANCEL_METHOD) 
    15661566    { 
    15671567        /* Invalid CSeq. 
     
    15951595 
    15961596    /* Create UAS transaction for this request. */ 
    1597     if (pjsip_rdata_get_tsx(rdata) == NULL &&  
    1598         rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD)  
     1597    if (pjsip_rdata_get_tsx(rdata) == NULL && 
     1598        rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD) 
    15991599    { 
    16001600        status = pjsip_tsx_create_uas(dlg->ua, rdata, &tsx); 
     
    16301630 
    16311631        contact = (pjsip_contact_hdr*) 
    1632                   pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT,  
     1632                  pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 
    16331633                                     NULL); 
    16341634        if (contact && contact->uri && 
     
    16381638                           contact->uri))) 
    16391639        { 
    1640             dlg->remote.contact = (pjsip_contact_hdr*)  
     1640            dlg->remote.contact = (pjsip_contact_hdr*) 
    16411641                                  pjsip_hdr_clone(dlg->pool, contact); 
    16421642            dlg->target = dlg->remote.contact->uri; 
     
    16881688{ 
    16891689    const pjsip_hdr *hdr, *end_hdr; 
    1690     pj_int32_t msg_cseq; 
     1690    //pj_int32_t msg_cseq; 
    16911691    const pjsip_msg *msg; 
    16921692 
    16931693    msg = rdata->msg_info.msg; 
    1694     msg_cseq = rdata->msg_info.cseq->cseq; 
     1694    //msg_cseq = rdata->msg_info.cseq->cseq; 
    16951695 
    16961696    /* Ignore if route set has been frozen */ 
     
    17081708 
    17091709        /* Ignore subsequent responses with higher CSeq than initial CSeq. 
    1710          * Unfortunately this would be broken when the first request is  
     1710         * Unfortunately this would be broken when the first request is 
    17111711         * challenged! 
    17121712         */ 
     
    17471747    PJ_LOG(5,(dlg->obj_name, "Route-set updated")); 
    17481748 
    1749     /* Freeze the route set only when the route set comes in 2xx response.  
    1750      * If it is in 1xx response, prepare to recompute the route set when  
     1749    /* Freeze the route set only when the route set comes in 2xx response. 
     1750     * If it is in 1xx response, prepare to recompute the route set when 
    17511751     * the 2xx response comes in. 
    17521752     * 
     
    17561756     * upon receiving 2xx response). Also RFC 3261 says so in 13.2.2.4. 
    17571757     * 
    1758      * The pjsip_method_creates_dialog() check protects from wrongly  
     1758     * The pjsip_method_creates_dialog() check protects from wrongly 
    17591759     * freezing the route set upon receiving 200/OK response for PRACK. 
    17601760     */ 
    17611761    if (pjsip_method_creates_dialog(&rdata->msg_info.cseq->method) && 
    1762         PJSIP_IS_STATUS_IN_CLASS(msg->line.status.code, 200))  
     1762        PJSIP_IS_STATUS_IN_CLASS(msg->line.status.code, 200)) 
    17631763    { 
    17641764        dlg->route_set_frozen = PJ_TRUE; 
     
    17891789    res_code = rdata->msg_info.msg->line.status.code; 
    17901790 
    1791     /* When we receive response that establishes dialog, update To tag,  
     1791    /* When we receive response that establishes dialog, update To tag, 
    17921792     * route set and dialog target. 
    17931793     * 
     
    18031803     * New update: 
    18041804     * We also need to update the dialog for 1xx responses, to handle the 
    1805      * case when 100rel is used, otherwise PRACK will be sent to the  
     1805     * case when 100rel is used, otherwise PRACK will be sent to the 
    18061806     * wrong target. 
    18071807     */ 
    1808     if ((dlg->state == PJSIP_DIALOG_STATE_NULL &&  
     1808    if ((dlg->state == PJSIP_DIALOG_STATE_NULL && 
    18091809         pjsip_method_creates_dialog(&rdata->msg_info.cseq->method) && 
    18101810         (res_code > 100 && res_code < 300) && 
    1811          rdata->msg_info.to->tag.slen)  
     1811         rdata->msg_info.to->tag.slen) 
    18121812         || 
    18131813        (dlg->role==PJSIP_ROLE_UAC && 
     
    18201820        pjsip_contact_hdr *contact; 
    18211821 
    1822         /* Update remote capability info, when To tags in the dialog remote  
     1822        /* Update remote capability info, when To tags in the dialog remote 
    18231823         * info and the incoming response are different, e.g: first response 
    18241824         * with To-tag or forking, apply strict update. 
     
    18341834        /* RFC 3271 Section 12.1.2: 
    18351835         * The route set MUST be set to the list of URIs in the Record-Route 
    1836          * header field from the response, taken in reverse order and  
    1837          * preserving all URI parameters. If no Record-Route header field  
    1838          * is present in the response, the route set MUST be set to the  
     1836         * header field from the response, taken in reverse order and 
     1837         * preserving all URI parameters. If no Record-Route header field 
     1838         * is present in the response, the route set MUST be set to the 
    18391839         * empty set. This route set, even if empty, overrides any pre-existing 
    18401840         * route set for future requests in this dialog. 
     
    18421842        dlg_update_routeset(dlg, rdata); 
    18431843 
    1844         /* The remote target MUST be set to the URI from the Contact header  
     1844        /* The remote target MUST be set to the URI from the Contact header 
    18451845         * field of the response. 
    18461846         */ 
    18471847        contact = (pjsip_contact_hdr*) 
    1848                   pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT,  
     1848                  pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 
    18491849                                     NULL); 
    18501850        if (contact && contact->uri && 
     
    18541854                           contact->uri))) 
    18551855        { 
    1856             dlg->remote.contact = (pjsip_contact_hdr*)  
     1856            dlg->remote.contact = (pjsip_contact_hdr*) 
    18571857                                  pjsip_hdr_clone(dlg->pool, contact); 
    18581858            dlg->target = dlg->remote.contact->uri; 
     
    18641864         * gets through this dialog (it shouldn't happen). 
    18651865         */ 
    1866         if (dlg->role==PJSIP_ROLE_UAC && !dlg->uac_has_2xx &&  
    1867             res_code/100==2)  
     1866        if (dlg->role==PJSIP_ROLE_UAC && !dlg->uac_has_2xx && 
     1867            res_code/100==2) 
    18681868        { 
    18691869            dlg->uac_has_2xx = PJ_TRUE; 
     
    18721872 
    18731873    /* Update remote target (again) when receiving 2xx response messages 
    1874      * that's defined as target refresh.  
     1874     * that's defined as target refresh. 
    18751875     * 
    18761876     * Also upon receiving 2xx response, recheck again the route set. 
     
    18821882        the "confirmed" state, and the route set for the dialog MUST be 
    18831883        recomputed based on the 2xx response using the procedures of Section 
    1884         12.2.1.2.  
     1884        12.2.1.2. 
    18851885 
    18861886        Note that the only piece of state that is recomputed is the route 
     
    18971897 
    18981898        contact = (pjsip_contact_hdr*) pjsip_msg_find_hdr(rdata->msg_info.msg, 
    1899                                                           PJSIP_H_CONTACT,  
     1899                                                          PJSIP_H_CONTACT, 
    19001900                                                          NULL); 
    19011901        if (contact && contact->uri && 
     
    19051905                           contact->uri))) 
    19061906        { 
    1907             dlg->remote.contact = (pjsip_contact_hdr*)  
     1907            dlg->remote.contact = (pjsip_contact_hdr*) 
    19081908                                  pjsip_hdr_clone(dlg->pool, contact); 
    19091909            dlg->target = dlg->remote.contact->uri; 
     
    19431943        pj_status_t status; 
    19441944 
    1945         if (rdata->msg_info.cseq->method.id==PJSIP_INVITE_METHOD &&  
    1946             rdata->msg_info.msg->line.status.code/100 == 2)  
     1945        if (rdata->msg_info.cseq->method.id==PJSIP_INVITE_METHOD && 
     1946            rdata->msg_info.msg->line.status.code/100 == 2) 
    19471947        { 
    19481948            pjsip_tx_data *ack; 
     
    19581958            pjsip_transaction *tsx = pjsip_rdata_get_tsx(rdata); 
    19591959            pjsip_tx_data *tdata; 
    1960              
    1961             status = pjsip_auth_clt_reinit_req( &dlg->auth_sess,  
     1960 
     1961            status = pjsip_auth_clt_reinit_req( &dlg->auth_sess, 
    19621962                                                rdata, tsx->last_tx, 
    19631963                                                &tdata); 
    1964              
     1964 
    19651965            if (status == PJ_SUCCESS) { 
    19661966                /* Re-send request. */ 
     
    20152015     */ 
    20162016    if (tsx->state == PJSIP_TSX_STATE_TERMINATED && 
    2017         tsx->mod_data[dlg->ua->id] == dlg)  
     2017        tsx->mod_data[dlg->ua->id] == dlg) 
    20182018    { 
    20192019        pj_assert(dlg->tsx_count>0); 
     
    20452045    pjsip_dlg_inc_lock(dlg); 
    20462046 
    2047     hdr = (const pjsip_generic_array_hdr*)  
     2047    hdr = (const pjsip_generic_array_hdr*) 
    20482048           pjsip_dlg_get_remote_cap_hdr(dlg, htype, hname); 
    20492049    if (!hdr) { 
     
    20722072                                                pj_bool_t strict) 
    20732073{ 
    2074     pjsip_hdr_e htypes[] =  
     2074    pjsip_hdr_e htypes[] = 
    20752075        { PJSIP_H_ACCEPT, PJSIP_H_ALLOW, PJSIP_H_SUPPORTED }; 
    20762076    unsigned i; 
Note: See TracChangeset for help on using the changeset viewer.