]> git.kaiwu.me - nginx.git/commitdiff
do not run regex for empty host name since regex always fails in this case,
authorIgor Sysoev <igor@sysoev.ru>
Thu, 22 Oct 2009 09:48:42 +0000 (09:48 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Thu, 22 Oct 2009 09:48:42 +0000 (09:48 +0000)
the bug had been introduced in r2196

src/http/ngx_http_request.c

index 3ae6ddb2844bd7de18e64ba71a0a618e62d88a61..a0c4ea3b8f13942fbe057005ef02fecaab41941a 100644 (file)
@@ -1688,7 +1688,7 @@ ngx_http_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len)
 
 #if (NGX_PCRE)
 
-    if (r->virtual_names->nregex) {
+    if (len && r->virtual_names->nregex) {
         size_t                   ncaptures;
         ngx_int_t                n;
         ngx_uint_t               i;