Ignore:
Timestamp:
Jul 18, 2012 7:52:33 AM (12 years ago)
Author:
ming
Message:

Fixed #1556: Fix From/To? tag and Via branch comparison to be case insensitive

File:
1 edited

Legend:

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

    r3664 r4208  
    303303 
    304304        dlg_set = (struct dlg_set*) 
    305                   pj_hash_get( mod_ua.dlg_table, dlg->local.info->tag.ptr,  
    306                                dlg->local.info->tag.slen, 
    307                                &dlg->local.tag_hval); 
     305                  pj_hash_get_lower( mod_ua.dlg_table, 
     306                                     dlg->local.info->tag.ptr,  
     307                                     dlg->local.info->tag.slen, 
     308                                     &dlg->local.tag_hval); 
    308309 
    309310        if (dlg_set) { 
     
    327328 
    328329            /* Register the dialog set in the hash table. */ 
    329             pj_hash_set_np(mod_ua.dlg_table,  
    330                            dlg->local.info->tag.ptr, dlg->local.info->tag.slen, 
    331                            dlg->local.tag_hval, dlg_set->ht_entry, dlg_set); 
     330            pj_hash_set_np_lower(mod_ua.dlg_table,  
     331                                 dlg->local.info->tag.ptr, 
     332                                 dlg->local.info->tag.slen, 
     333                                 dlg->local.tag_hval, dlg_set->ht_entry, 
     334                                 dlg_set); 
    332335        } 
    333336 
     
    342345        dlg->dlg_set = dlg_set; 
    343346 
    344         pj_hash_set_np(mod_ua.dlg_table,  
    345                        dlg->local.info->tag.ptr, dlg->local.info->tag.slen, 
    346                        dlg->local.tag_hval, dlg_set->ht_entry, dlg_set); 
     347        pj_hash_set_np_lower(mod_ua.dlg_table,  
     348                             dlg->local.info->tag.ptr, 
     349                             dlg->local.info->tag.slen, 
     350                             dlg->local.tag_hval, dlg_set->ht_entry, dlg_set); 
    347351    } 
    348352 
     
    388392    /* If dialog list is empty, remove the dialog set from the hash table. */ 
    389393    if (pj_list_empty(&dlg_set->dlg_list)) { 
    390         pj_hash_set(NULL, mod_ua.dlg_table, dlg->local.info->tag.ptr, 
    391                     dlg->local.info->tag.slen, dlg->local.tag_hval, NULL); 
     394        pj_hash_set_lower(NULL, mod_ua.dlg_table, dlg->local.info->tag.ptr, 
     395                          dlg->local.info->tag.slen, dlg->local.tag_hval, 
     396                          NULL); 
    392397 
    393398        /* Return dlg_set to free nodes. */ 
     
    450455    /* Lookup the dialog set. */ 
    451456    dlg_set = (struct dlg_set*) 
    452               pj_hash_get(mod_ua.dlg_table, local_tag->ptr, local_tag->slen, 
    453                           NULL); 
     457              pj_hash_get_lower(mod_ua.dlg_table, local_tag->ptr, 
     458                                local_tag->slen, NULL); 
    454459    if (dlg_set == NULL) { 
    455460        /* Not found */ 
     
    463468    dlg = dlg_set->dlg_list.next; 
    464469    while (dlg != (pjsip_dialog*)&dlg_set->dlg_list) {   
    465         if (pj_strcmp(&dlg->remote.info->tag, remote_tag) == 0) 
     470        if (pj_stricmp(&dlg->remote.info->tag, remote_tag) == 0) 
    466471            break; 
    467472        dlg = dlg->next; 
     
    564569        /* Lookup the dialog set. */ 
    565570        dlg_set = (struct dlg_set*) 
    566                   pj_hash_get(mod_ua.dlg_table, tag->ptr, tag->slen, NULL); 
     571                  pj_hash_get_lower(mod_ua.dlg_table, tag->ptr, tag->slen, 
     572                                    NULL); 
    567573        return dlg_set; 
    568574    } 
     
    625631    while (dlg != (pjsip_dialog*)&dlg_set->dlg_list) { 
    626632         
    627         if (pj_strcmp(&dlg->remote.info->tag, from_tag) == 0) 
     633        if (pj_stricmp(&dlg->remote.info->tag, from_tag) == 0) 
    628634            break; 
    629635 
     
    762768        /* Get the dialog set. */ 
    763769        dlg_set = (struct dlg_set*) 
    764                   pj_hash_get(mod_ua.dlg_table,  
    765                               rdata->msg_info.from->tag.ptr, 
    766                               rdata->msg_info.from->tag.slen, 
    767                               NULL); 
     770                  pj_hash_get_lower(mod_ua.dlg_table,  
     771                                    rdata->msg_info.from->tag.ptr, 
     772                                    rdata->msg_info.from->tag.slen, 
     773                                    NULL); 
    768774 
    769775        if (!dlg_set) { 
     
    813819 
    814820            /* Otherwise find the one with matching To tag. */ 
    815             if (pj_strcmp(to_tag, &dlg->remote.info->tag) == 0) 
     821            if (pj_stricmp(to_tag, &dlg->remote.info->tag) == 0) 
    816822                break; 
    817823 
Note: See TracChangeset for help on using the changeset viewer.