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_transaction.c

    r4165 r4208  
    404404    const pj_str_t *branch = &rdata->msg_info.via->branch_param; 
    405405 
    406     if (pj_strncmp(branch,&rfc3261_branch,PJSIP_RFC3261_BRANCH_LEN)==0) { 
     406    if (pj_strnicmp(branch,&rfc3261_branch,PJSIP_RFC3261_BRANCH_LEN)==0) { 
    407407 
    408408        /* Create transaction key. */ 
     
    549549     * twice! 
    550550     */ 
    551     if(pj_hash_get(mod_tsx_layer.htable,  
    552                    tsx->transaction_key.ptr, 
    553                    tsx->transaction_key.slen,  
    554                    NULL)) 
     551    if(pj_hash_get_lower(mod_tsx_layer.htable,  
     552                         tsx->transaction_key.ptr, 
     553                         tsx->transaction_key.slen,  
     554                         NULL)) 
    555555    { 
    556556        pj_mutex_unlock(mod_tsx_layer.mutex); 
     
    569569    /* Register the transaction to the hash table. */ 
    570570#ifdef PRECALC_HASH 
    571     pj_hash_set( tsx->pool, mod_tsx_layer.htable, tsx->transaction_key.ptr, 
    572                  tsx->transaction_key.slen, tsx->hashed_key, tsx); 
     571    pj_hash_set_lower( tsx->pool, mod_tsx_layer.htable, 
     572                       tsx->transaction_key.ptr, 
     573                       tsx->transaction_key.slen, tsx->hashed_key, tsx); 
    573574#else 
    574     pj_hash_set( tsx->pool, mod_tsx_layer.htable, tsx->transaction_key.ptr, 
    575                  tsx->transaction_key.slen, 0, tsx); 
     575    pj_hash_set_lower( tsx->pool, mod_tsx_layer.htable, 
     576                       tsx->transaction_key.ptr, 
     577                       tsx->transaction_key.slen, 0, tsx); 
    576578#endif 
    577579 
     
    605607    /* Register the transaction to the hash table. */ 
    606608#ifdef PRECALC_HASH 
    607     pj_hash_set( NULL, mod_tsx_layer.htable, tsx->transaction_key.ptr, 
    608                  tsx->transaction_key.slen, tsx->hashed_key, NULL); 
     609    pj_hash_set_lower( NULL, mod_tsx_layer.htable, tsx->transaction_key.ptr, 
     610                       tsx->transaction_key.slen, tsx->hashed_key, NULL); 
    609611#else 
    610     pj_hash_set( NULL, mod_tsx_layer.htable, tsx->transaction_key.ptr, 
    611                  tsx->transaction_key.slen, 0, NULL); 
     612    pj_hash_set_lower( NULL, mod_tsx_layer.htable, tsx->transaction_key.ptr, 
     613                       tsx->transaction_key.slen, 0, NULL); 
    612614#endif 
    613615 
     
    652654    pj_mutex_lock(mod_tsx_layer.mutex); 
    653655    tsx = (pjsip_transaction*) 
    654           pj_hash_get( mod_tsx_layer.htable, key->ptr, key->slen, &hval ); 
     656          pj_hash_get_lower( mod_tsx_layer.htable, key->ptr, key->slen, 
     657                             &hval ); 
    655658    pj_mutex_unlock(mod_tsx_layer.mutex); 
    656659 
     
    786789 
    787790    tsx = (pjsip_transaction*)  
    788           pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, &hval ); 
     791          pj_hash_get_lower( mod_tsx_layer.htable, key.ptr, key.slen, &hval ); 
    789792 
    790793 
     
    835838 
    836839    tsx = (pjsip_transaction*)  
    837           pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, &hval ); 
     840          pj_hash_get_lower( mod_tsx_layer.htable, key.ptr, key.slen, &hval ); 
    838841 
    839842 
     
    13001303    /* Calculate hashed key value. */ 
    13011304#ifdef PRECALC_HASH 
    1302     tsx->hashed_key = pj_hash_calc(0, tsx->transaction_key.ptr, 
    1303                                    tsx->transaction_key.slen); 
     1305    tsx->hashed_key = pj_hash_calc_tolower(0, NULL, &tsx->transaction_key); 
    13041306#endif 
    13051307 
     
    14331435    /* Calculate hashed key value. */ 
    14341436#ifdef PRECALC_HASH 
    1435     tsx->hashed_key = pj_hash_calc(0, tsx->transaction_key.ptr, 
    1436                                    tsx->transaction_key.slen); 
     1437    tsx->hashed_key = pj_hash_calc_tolower(0, NULL, &tsx->transaction_key); 
    14371438#endif 
    14381439 
Note: See TracChangeset for help on using the changeset viewer.