diff src/http/modules/ngx_http_map_module.c @ 392: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
line wrap: on
line diff
--- a/src/http/modules/ngx_http_map_module.c
+++ b/src/http/modules/ngx_http_map_module.c
@@ -106,7 +106,7 @@ ngx_http_map_variable(ngx_http_request_t
 
     size_t                      len;
     u_char                     *name;
-    ngx_uint_t                  key, i;
+    ngx_uint_t                  key;
     ngx_http_variable_value_t  *vv, *value;
 
     ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
@@ -135,11 +135,7 @@ ngx_http_map_variable(ngx_http_request_t
         return NGX_ERROR;
     }
 
-    key = 0;
-    for (i = 0; i < len; i++) {
-        name[i] = ngx_tolower(vv->data[i]);
-        key = ngx_hash(key, name[i]);
-    }
+    key = ngx_hash_strlow(name, vv->data, len);
 
     value = ngx_hash_find_combined(&map->hash, key, name, len);