Mercurial > hg > nginx-vendor-current
diff src/http/ngx_http_variables.c @ 628:83b58b182b76 NGINX_1_0_4
nginx 1.0.4
*) Change: now regular expressions case sensitivity in the "map"
directive is given by prefixes "~" or "~*".
*) Feature: now shared zones and caches use POSIX semaphores on Linux.
Thanks to Denis F. Latypoff.
*) Bugfix: "stalled" cache updating" alert.
*) Bugfix: nginx could not be built --without-http_auth_basic_module;
the bug had appeared in 1.0.3.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 01 Jun 2011 00:00:00 +0400 |
parents | 8214eaef3530 |
children | 753f505670e0 |
line wrap: on
line diff
--- a/src/http/ngx_http_variables.c +++ b/src/http/ngx_http_variables.c @@ -1661,14 +1661,30 @@ ngx_http_variable_pid(ngx_http_request_t void * -ngx_http_map_find(ngx_http_request_t *r, ngx_http_map_t *map, ngx_uint_t key, - u_char *text, size_t len, ngx_str_t *match) +ngx_http_map_find(ngx_http_request_t *r, ngx_http_map_t *map, ngx_str_t *match) { - void *p; - - p = ngx_hash_find_combined(&map->hash, key, text, len); - if (p) { - return p; + void *value; + u_char *low; + size_t len; + ngx_uint_t key; + + len = match->len; + + if (len) { + low = ngx_pnalloc(r->pool, len); + if (low == NULL) { + return NULL; + } + + } else { + low = NULL; + } + + key = ngx_hash_strlow(low, match->data, len); + + value = ngx_hash_find_combined(&map->hash, key, low, len); + if (value) { + return value; } #if (NGX_PCRE)