comparison src/http/ngx_http_variables.c @ 3929:fa4612bfb9fa

change ngx_http_map_find(): use case sensitive regexes
author Igor Sysoev <igor@sysoev.ru>
date Mon, 30 May 2011 12:36:17 +0000
parents 83cd1910329c
children 4d9f985fd217 dfb04ceb266f
comparison
equal deleted inserted replaced
3928:105841a157b9 3929:fa4612bfb9fa
1659 return NGX_OK; 1659 return NGX_OK;
1660 } 1660 }
1661 1661
1662 1662
1663 void * 1663 void *
1664 ngx_http_map_find(ngx_http_request_t *r, ngx_http_map_t *map, ngx_uint_t key, 1664 ngx_http_map_find(ngx_http_request_t *r, ngx_http_map_t *map, ngx_str_t *match)
1665 u_char *text, size_t len, ngx_str_t *match) 1665 {
1666 { 1666 void *value;
1667 void *p; 1667 u_char *low;
1668 1668 size_t len;
1669 p = ngx_hash_find_combined(&map->hash, key, text, len); 1669 ngx_uint_t key;
1670 if (p) { 1670
1671 return p; 1671 len = match->len;
1672
1673 if (len) {
1674 low = ngx_pnalloc(r->pool, len);
1675 if (low == NULL) {
1676 return NULL;
1677 }
1678
1679 } else {
1680 low = NULL;
1681 }
1682
1683 key = ngx_hash_strlow(low, match->data, len);
1684
1685 value = ngx_hash_find_combined(&map->hash, key, low, len);
1686 if (value) {
1687 return value;
1672 } 1688 }
1673 1689
1674 #if (NGX_PCRE) 1690 #if (NGX_PCRE)
1675 1691
1676 if (len && map->nregex) { 1692 if (len && map->nregex) {