# HG changeset patch # User Igor Sysoev # Date 1127486629 0 # Node ID 0148586012ab3dde69b394ec5a389d44bb11c869 # Parent a65976d924b76b2d16d03fa164a0cc025cc4cb56 nginx-0.2.1-RELEASE import *) Bugfix: if all backend using in load-balancing failed after one error, then nginx may got caught in an endless loop; the bug had appeared in 0.2.0. diff --git a/docs/xml/nginx/changes.xml b/docs/xml/nginx/changes.xml --- a/docs/xml/nginx/changes.xml +++ b/docs/xml/nginx/changes.xml @@ -9,6 +9,24 @@ nginx changelog + + + + +если все бэкенды, используемые для балансировки нагрузки, оказывались +в нерабочем состоянии после одной ошибки, то nginx мог зациклится; +ошибка появилась в 0.2.0. + + +if all backend using in load-balancing failed after one error, then +nginx may got caught in an endless loop; +bug appeared in 0.2.0. + + + + + + @@ -104,7 +122,6 @@ nginx did not try do connect to them dur in IMAP/POP3 command argument parsing. -Thanks to Rob Mueller. diff --git a/src/core/nginx.h b/src/core/nginx.h --- a/src/core/nginx.h +++ b/src/core/nginx.h @@ -8,7 +8,7 @@ #define _NGINX_H_INCLUDED_ -#define NGINX_VER "nginx/0.2.0" +#define NGINX_VER "nginx/0.2.1" #define NGINX_VAR "NGINX" #define NGX_OLDPID_EXT ".oldbin" diff --git a/src/core/ngx_conf_file.h b/src/core/ngx_conf_file.h --- a/src/core/ngx_conf_file.h +++ b/src/core/ngx_conf_file.h @@ -97,19 +97,20 @@ struct ngx_open_file_s { }; -#define NGX_MODULE_V1 0, 0, 1, 0, 0, 0, 0 +#define NGX_MODULE_V1 0, 0, 0, 0, 0, 0, 1 #define NGX_MODULE_V1_PADDING 0, 0, 0, 0, 0, 0, 0, 0 struct ngx_module_s { ngx_uint_t ctx_index; ngx_uint_t index; - ngx_uint_t version; ngx_uint_t spare0; ngx_uint_t spare1; ngx_uint_t spare2; ngx_uint_t spare3; + ngx_uint_t version; + void *ctx; ngx_command_t *commands; ngx_uint_t type; diff --git a/src/event/ngx_event_connect.c b/src/event/ngx_event_connect.c --- a/src/event/ngx_event_connect.c +++ b/src/event/ngx_event_connect.c @@ -360,5 +360,7 @@ ngx_event_connect_peer_failed(ngx_peer_c pc->cur_peer = 0; } - pc->tries--; + if (pc->tries) { + pc->tries--; + } }