# HG changeset patch # User Igor Sysoev # Date 1169758800 -10800 # Node ID fa73fb2d94279b7ba0cfcd835bc7ecb7a1983cc4 # Parent 0188c538bd60858cf88257ea3d137309e49d2ff1 nginx 0.5.10 *) Bugfix: while online executable file upgrade the new master process did not inherit the listening sockets; bug appeared in 0.5.9. *) Bugfix: a segmentation fault might occur in worker process if nginx was built with -O2 optimization; bug appeared in 0.5.1. diff --git a/CHANGES b/CHANGES --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,13 @@ +Changes with nginx 0.5.10 26 Jan 2007 + + *) Bugfix: while online executable file upgrade the new master process + did not inherit the listening sockets; bug appeared in 0.5.9. + + *) Bugfix: a segmentation fault might occur in worker process if nginx + was built with -O2 optimization; bug appeared in 0.5.1. + + Changes with nginx 0.5.9 25 Jan 2007 *) Change: now the ngx_http_memcached_module uses the $memcached_key diff --git a/CHANGES.ru b/CHANGES.ru --- a/CHANGES.ru +++ b/CHANGES.ru @@ -1,4 +1,13 @@ +Изменения в nginx 0.5.10 26.01.2007 + + *) Исправление: во время обновления исполняемого файла новый процесс не + наследовал слушающие сокеты; ошибка появилась в 0.5.9. + + *) Исправление: при сборке с оптимизацией -O2 в рабочем процессе мог + произойти segmentation fault; ошибка появилась в 0.5.1. + + Изменения в nginx 0.5.9 25.01.2007 *) Изменение: модуль ngx_http_memcached_module теперь в качестве ключа diff --git a/src/core/nginx.c b/src/core/nginx.c --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -423,15 +423,8 @@ ngx_set_environment(ngx_cycle_t *cycle, ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module); - if (last) { - n = *last; - - } else { - if (ccf->environment) { - return ccf->environment; - } - - n = 0; + if (last == NULL && ccf->environment) { + return ccf->environment; } var = ccf->env.elts; @@ -453,6 +446,8 @@ ngx_set_environment(ngx_cycle_t *cycle, tz_found: + n = 0; + for (i = 0; i < ccf->env.nelts; i++) { if (var[i].data[var[i].len] == '=') { @@ -472,8 +467,8 @@ tz_found: } if (last) { + env = ngx_alloc((*last + n + 1) * sizeof(char *), cycle->log); *last = n; - env = ngx_alloc((n + 1) * sizeof(char *), cycle->log); } else { env = ngx_palloc(cycle->pool, (n + 1) * sizeof(char *)); 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_VERSION "0.5.9" +#define NGINX_VERSION "0.5.10" #define NGINX_VER "nginx/" NGINX_VERSION #define NGINX_VAR "NGINX" diff --git a/src/core/ngx_times.c b/src/core/ngx_times.c --- a/src/core/ngx_times.c +++ b/src/core/ngx_times.c @@ -101,7 +101,7 @@ ngx_time_update(time_t sec, ngx_uint_t m ngx_gmtime(sec, &gmt); - p0 = cached_http_time[slot]; + p0 = &cached_http_time[slot][0]; (void) ngx_sprintf(p0, "%s, %02d %s %4d %02d:%02d:%02d GMT", week[gmt.ngx_tm_wday], gmt.ngx_tm_mday, @@ -126,7 +126,7 @@ ngx_time_update(time_t sec, ngx_uint_t m #endif - p1 = cached_err_log_time[slot]; + p1 = &cached_err_log_time[slot][0]; (void) ngx_sprintf(p1, "%4d/%02d/%02d %02d:%02d:%02d", tm.ngx_tm_year, tm.ngx_tm_mon, @@ -134,7 +134,7 @@ ngx_time_update(time_t sec, ngx_uint_t m tm.ngx_tm_min, tm.ngx_tm_sec); - p2 = cached_http_log_time[slot]; + p2 = &cached_http_log_time[slot][0]; (void) ngx_sprintf(p2, "%02d/%s/%d:%02d:%02d:%02d %c%02d%02d", tm.ngx_tm_mday, months[tm.ngx_tm_mon - 1], diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm --- a/src/http/modules/perl/nginx.pm +++ b/src/http/modules/perl/nginx.pm @@ -47,7 +47,7 @@ our @EXPORT = qw( HTTP_INSUFFICIENT_STORAGE ); -our $VERSION = '0.5.9'; +our $VERSION = '0.5.10'; require XSLoader; XSLoader::load('nginx', $VERSION);