Mercurial > hg > nginx
comparison src/http/modules/ngx_http_map_module.c @ 2136:7a7c9e9024dd
ngx_hash_strlow()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 04 Aug 2008 10:18:36 +0000 |
parents | 2a92804f4109 |
children | a6d6d762c554 |
comparison
equal
deleted
inserted
replaced
2135:8c6521eedf84 | 2136:7a7c9e9024dd |
---|---|
104 { | 104 { |
105 ngx_http_map_ctx_t *map = (ngx_http_map_ctx_t *) data; | 105 ngx_http_map_ctx_t *map = (ngx_http_map_ctx_t *) data; |
106 | 106 |
107 size_t len; | 107 size_t len; |
108 u_char *name; | 108 u_char *name; |
109 ngx_uint_t key, i; | 109 ngx_uint_t key; |
110 ngx_http_variable_value_t *vv, *value; | 110 ngx_http_variable_value_t *vv, *value; |
111 | 111 |
112 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 112 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
113 "http map started"); | 113 "http map started"); |
114 | 114 |
133 name = ngx_pnalloc(r->pool, len); | 133 name = ngx_pnalloc(r->pool, len); |
134 if (name == NULL) { | 134 if (name == NULL) { |
135 return NGX_ERROR; | 135 return NGX_ERROR; |
136 } | 136 } |
137 | 137 |
138 key = 0; | 138 key = ngx_hash_strlow(name, vv->data, len); |
139 for (i = 0; i < len; i++) { | |
140 name[i] = ngx_tolower(vv->data[i]); | |
141 key = ngx_hash(key, name[i]); | |
142 } | |
143 | 139 |
144 value = ngx_hash_find_combined(&map->hash, key, name, len); | 140 value = ngx_hash_find_combined(&map->hash, key, name, len); |
145 | 141 |
146 if (value) { | 142 if (value) { |
147 *v = *value; | 143 *v = *value; |