# HG changeset patch # User Igor Sysoev # Date 1253798605 0 # Node ID 90d6b878481fde5ec62875d3c0261c6027c14f17 # Parent 8bf534c7c99884d0bcbd14bc96e50b0bfdb03807 update the previous commit: use ngx_strlow() diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -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_ } 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;