comparison src/http/modules/ngx_http_map_module.c @ 394:34fb3a573548 NGINX_0_7_8

nginx 0.7.8 *) Feature: the ngx_http_xslt_module. *) Feature: the "$arg_..." variables. *) Feature: Solaris directio support. Thanks to Ivan Debnar. *) Bugfix: now if FastCGI server sends a "Location" header line without status line, then nginx uses 302 status code. Thanks to Maxim Dounin.
author Igor Sysoev <http://sysoev.ru>
date Mon, 04 Aug 2008 00:00:00 +0400
parents 984bb0b1399b
children a8424ffa495c
comparison
equal deleted inserted replaced
393:4ec606a899d3 394:34fb3a573548
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;