summaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-08-04 15:05:24 +0000
committerJonathan Kolb <jon@b0g.us>2008-08-04 15:05:24 +0000
commite2b02861808fe0540d9e824c4a6269e059f9ebcb (patch)
treef4e517379e41252071b525a8f9242f0823b38dda /src/http/ngx_http_request.c
parent49d825b7bd87fb50315138ac87135c1d85354d5a (diff)
downloadnginx-e2b02861808fe0540d9e824c4a6269e059f9ebcb.tar.gz
CHANGES not updated for this versionv0.7.8
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 9aad1a487..61a41d4b2 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -647,6 +647,7 @@ ngx_http_process_request_line(ngx_event_t *rev)
r->request_line.len = r->request_end - r->request_start;
r->request_line.data = r->request_start;
+ *r->request_end = '\0';
if (r->args_start) {
@@ -818,7 +819,6 @@ ngx_http_process_request_headers(ngx_event_t *rev)
ssize_t n;
ngx_int_t rc, rv;
ngx_str_t header;
- ngx_uint_t i;
ngx_table_elt_t *h;
ngx_connection_t *c;
ngx_http_header_t *hh;
@@ -928,9 +928,7 @@ ngx_http_process_request_headers(ngx_event_t *rev)
ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
} else {
- for (i = 0; i < h->key.len; i++) {
- h->lowcase_key[i] = ngx_tolower(h->key.data[i]);
- }
+ ngx_strlow(h->lowcase_key, h->key.data, h->key.len);
}
hh = ngx_hash_find(&cmcf->headers_in_hash, h->hash,
@@ -1552,8 +1550,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];
@@ -1572,16 +1570,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);