comparison src/http/modules/ngx_http_map_module.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 cb2432ed17fd
children ace14fd91086
comparison
equal deleted inserted replaced
3928:105841a157b9 3929:fa4612bfb9fa
109 { 109 {
110 ngx_http_map_ctx_t *map = (ngx_http_map_ctx_t *) data; 110 ngx_http_map_ctx_t *map = (ngx_http_map_ctx_t *) data;
111 111
112 size_t len; 112 size_t len;
113 ngx_str_t val; 113 ngx_str_t val;
114 ngx_uint_t key;
115 ngx_http_variable_value_t *value; 114 ngx_http_variable_value_t *value;
116 115
117 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 116 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
118 "http map started"); 117 "http map started");
119 118
125 124
126 if (len && map->hostnames && val.data[len - 1] == '.') { 125 if (len && map->hostnames && val.data[len - 1] == '.') {
127 len--; 126 len--;
128 } 127 }
129 128
130 key = ngx_hash_strlow(val.data, val.data, len); 129 value = ngx_http_map_find(r, &map->map, &val);
131
132 value = ngx_http_map_find(r, &map->map, key, val.data, len, &val);
133 130
134 if (value == NULL) { 131 if (value == NULL) {
135 value = map->default_value; 132 value = map->default_value;
136 } 133 }
137 134