# HG changeset patch # User Igor Sysoev # Date 1100206689 0 # Node ID 1f31dc6d33a3a4e65240b08066bf186df9e33b79 # Parent ee5b8168154c335bb0694377dfc8490078a49fd6 nginx-0.1.6-RELEASE import *) Bugfix: some location directive combinations with the regular expressions caused the wrong configuration choose. diff -r ee5b8168154c -r 1f31dc6d33a3 docs/xml/nginx/changes.xml --- a/docs/xml/nginx/changes.xml Thu Nov 11 14:07:14 2004 +0000 +++ b/docs/xml/nginx/changes.xml Thu Nov 11 20:58:09 2004 +0000 @@ -6,6 +6,22 @@ title="nginx"> + + + + +при некоторых комбинациях директив location c регулярными выражениями +использовалась конфигурация не из того location. + + +some location directive combiations with the regular expressions caused +the wrong configuration choose. + + + + + + @@ -22,11 +38,11 @@ в режиме прокси без использования sendfile на Solaris возникала -ошибка "writev() failed (22: Invalid argument)". На других платформах, -не поддерживающих sendfile, процесс зацикливался. +ошибка "writev() failed (22: Invalid argument)". +На других платформах, не поддерживающих sendfile, процесс зацикливался. -there were the "writev() failed (22: Invalid argument)" errors on +there were the "writev() failed (22: Invalid argument)" errors on Solaris in proxy mode without sendfile. On other platforms that do not support sendfile at all the process got caught in an endless loop. diff -r ee5b8168154c -r 1f31dc6d33a3 src/core/nginx.h --- a/src/core/nginx.h Thu Nov 11 14:07:14 2004 +0000 +++ b/src/core/nginx.h Thu Nov 11 20:58:09 2004 +0000 @@ -8,7 +8,7 @@ #define _NGINX_H_INCLUDED_ -#define NGINX_VER "nginx/0.1.5" +#define NGINX_VER "nginx/0.1.6" #define NGINX_VAR "NGINX" #define NGX_NEWPID_EXT ".newbin" diff -r ee5b8168154c -r 1f31dc6d33a3 src/http/ngx_http_core_module.c --- a/src/http/ngx_http_core_module.c Thu Nov 11 14:07:14 2004 +0000 +++ b/src/http/ngx_http_core_module.c Thu Nov 11 20:58:09 2004 +0000 @@ -992,6 +992,11 @@ return 1; } + if (!first->regex && second->regex) { + /* shift the regex matches to the end */ + return -1; + } + if (first->regex || second->regex) { /* do not sort the regex matches */ return 0; @@ -1061,8 +1066,7 @@ if (cf->args->nelts == 3) { if (value[1].len == 1 && value[1].data[0] == '=') { - clcf->name.len = value[2].len; - clcf->name.data = value[2].data; + clcf->name = value[2]; clcf->exact_match = 1; } else if ((value[1].len == 1 && value[1].data[0] == '~') @@ -1098,8 +1102,7 @@ } } else { - clcf->name.len = value[1].len; - clcf->name.data = value[1].data; + clcf->name = value[1]; } pclcf = pctx->loc_conf[ngx_http_core_module.ctx_index];