]> git.kaiwu.me - nginx.git/commitdiff
update the previous commit: use ngx_strlow()
authorIgor Sysoev <igor@sysoev.ru>
Thu, 24 Sep 2009 13:23:25 +0000 (13:23 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Thu, 24 Sep 2009 13:23:25 +0000 (13:23 +0000)
src/http/ngx_http_request.c

index e755e9c2cc67b19e38e404141f837d32427e4c27..48b57206b4c4c17c2b63747da15d836cdac29ae8 100644 (file)
@@ -1616,7 +1616,7 @@ static ssize_t
 ngx_http_validate_host(ngx_http_request_t *r, u_char **host, size_t len,
     ngx_uint_t alloc)
 {
-    u_char      *p, *h, ch;
+    u_char      *h, ch;
     size_t       i, last;
     ngx_uint_t   dot;
 
@@ -1657,16 +1657,12 @@ ngx_http_validate_host(ngx_http_request_t *r, u_char **host, size_t len,
     }
 
     if (alloc) {
-        p = ngx_pnalloc(r->pool, last) ;
-        if (p == NULL) {
+        *host = ngx_pnalloc(r->pool, last) ;
+        if (*host == NULL) {
             return -1;
         }
 
-        *host = p;
-
-        for (i = 0; i < last; i++) {
-            *p++ = ngx_tolower(h[i]);
-        }
+        ngx_strlow(*host, h, last);
     }
 
     return last;