aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-08-04 10:18:36 +0000
committerIgor Sysoev <igor@sysoev.ru>2008-08-04 10:18:36 +0000
commit6a07833d478a9b969dfa8a66041fc8537ee2b8d1 (patch)
treea0e474a1f7f37eb763e2c7fa27f0de89fbaa84d2 /src/http/ngx_http_request.c
parent777b019c7338b6a67f639bb86b90711055709c53 (diff)
downloadnginx-6a07833d478a9b969dfa8a66041fc8537ee2b8d1.tar.gz
nginx-6a07833d478a9b969dfa8a66041fc8537ee2b8d1.zip
ngx_hash_strlow()
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index ec36f5086..2a0ed7a44 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -1549,8 +1549,8 @@ ngx_http_validate_host(u_char *host, size_t len)
static ngx_int_t
ngx_http_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len)
{
- u_char *server, ch;
- ngx_uint_t i, hash;
+ u_char *server;
+ ngx_uint_t hash;
ngx_http_core_loc_conf_t *clcf;
ngx_http_core_srv_conf_t *cscf;
u_char buf[32];
@@ -1569,16 +1569,7 @@ ngx_http_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len)
}
}
- hash = 0;
-
- for (i = 0; i < len; i++) {
- ch = host[i];
-
- ch = ngx_tolower(ch);
- server[i] = ch;
-
- hash = ngx_hash(hash, ch);
- }
+ hash = ngx_hash_strlow(server, host, len);
cscf = ngx_hash_find_combined(&r->virtual_names->names, hash, server, len);