diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2011-06-01 09:30:12 +0000 |
|---|---|---|
| committer | Jonathan Kolb <jon@b0g.us> | 2011-06-01 09:30:12 +0000 |
| commit | 8852bb49fe4ee5b4d0f27c28d4901f4b6cd5e8c3 (patch) | |
| tree | 29b465601b29df8385f984684ee141b3832e3962 /src/http/ngx_http_variables.c | |
| parent | 05db4154017269f45cc8742ca187855e1331b08d (diff) | |
| download | nginx-8852bb49fe4ee5b4d0f27c28d4901f4b6cd5e8c3.tar.gz | |
Changes with nginx 1.0.4 01 Jun 2011v1.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.
Diffstat (limited to 'src/http/ngx_http_variables.c')
| -rw-r--r-- | src/http/ngx_http_variables.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c index 3946e3867..4afd88405 100644 --- 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 *r, 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; + void *value; + u_char *low; + size_t len; + ngx_uint_t key; - p = ngx_hash_find_combined(&map->hash, key, text, len); - if (p) { - return p; + 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) |
