From 14072c029c6aa2fae365ee6031db742510e9e57b Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Wed, 7 Nov 2012 04:56:26 +0000 Subject: Re #1556: Fixed hash key case insensitive comparison. This is reported to cause CANCEL request will be responded with 481 (Transaction does not exist) when the Via branch is not started with magic cookie (old SIP RFC), thanks Marcus Froeschl for the report. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4296 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/src/pj/hash.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'pjlib') diff --git a/pjlib/src/pj/hash.c b/pjlib/src/pj/hash.c index 7ad339be..7bce8b6e 100644 --- a/pjlib/src/pj/hash.c +++ b/pjlib/src/pj/hash.c @@ -178,17 +178,12 @@ static pj_hash_entry **find_entry( pj_pool_t *pool, pj_hash_table_t *ht, entry; p_entry = &entry->next, entry = *p_entry) { - pj_str_t str; - - if (lower) { - str.ptr = (char *)entry->key; - str.slen = keylen; - } if (entry->hash==hash && entry->keylen==keylen && - ((lower && pj_strnicmp2(&str, (const char *)key, keylen)==0) || + ((lower && pj_ansi_strnicmp((const char*)entry->key, + (const char*)key, keylen)==0) || (!lower && pj_memcmp(entry->key, key, keylen)==0))) { - break; + break; } } -- cgit v1.2.3