FS-6342 --resolve regression from 804ef7709d Missed part of properly implementing the case-insensitive mode on the hash causing the dp lookup xml not to match XML

This commit is contained in:
Anthony Minessale 2014-03-12 04:50:42 +05:00
parent 9fd30a2cd9
commit bcec5e22a2
2 changed files with 10 additions and 1 deletions

View File

@ -199,6 +199,11 @@ static inline int switch_hash_equalkeys(void *k1, void *k2)
return strcmp((char *) k1, (char *) k2) ? 0 : 1;
}
static inline int switch_hash_equalkeys_ci(void *k1, void *k2)
{
return strcasecmp((char *) k1, (char *) k2) ? 0 : 1;
}
static inline uint32_t switch_hash_default(void *ky)
{
unsigned char *str = (unsigned char *) ky;

View File

@ -38,7 +38,11 @@
SWITCH_DECLARE(switch_status_t) switch_core_hash_init_case(switch_hash_t **hash, switch_bool_t case_sensitive)
{
return switch_create_hashtable(hash, 16, case_sensitive ? switch_hash_default : switch_hash_default_ci, switch_hash_equalkeys);
if (case_sensitive) {
return switch_create_hashtable(hash, 16, switch_hash_default, switch_hash_equalkeys);
} else {
return switch_create_hashtable(hash, 16, switch_hash_default_ci, switch_hash_equalkeys_ci);
}
}