summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES15
-rw-r--r--CHANGES.ru15
-rw-r--r--src/core/nginx.h2
-rw-r--r--src/core/ngx_cycle.c3
-rw-r--r--src/core/ngx_shmtx.c3
-rw-r--r--src/event/ngx_event_pipe.c18
-rw-r--r--src/http/modules/ngx_http_fastcgi_module.c43
-rw-r--r--src/http/modules/perl/nginx.pm2
-rw-r--r--src/http/ngx_http_upstream.c4
-rw-r--r--src/os/unix/ngx_solaris_config.h2
10 files changed, 86 insertions, 21 deletions
diff --git a/CHANGES b/CHANGES
index 630822591..a9aa08c90 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,19 @@
+Changes with nginx 0.5.12 12 Feb 2007
+
+ *) Bugfix: nginx could not be built on platforms different from i386,
+ amd64, sparc и ppc; bug appeared in 0.5.8.
+
+ *) Bugfix: a segmentation fault might occur in worker process if the
+ temporarily files were used while working with FastCGI server; bug
+ appeared in 0.5.8.
+
+ *) Bugfix: a segmentation fault might occur in worker process if the
+ $fastcgi_script_name variable was logged.
+
+ *) Bugfix: ngx_http_perl_module could not be built on Solaris.
+
+
Changes with nginx 0.5.11 05 Feb 2007
*) Feature: now configure detects system PCRE library in MacPorts.
diff --git a/CHANGES.ru b/CHANGES.ru
index 4c6f7edf2..cbde7c7d2 100644
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,4 +1,19 @@
+Изменения в nginx 0.5.12 12.02.2007
+
+ *) Исправление: nginx не собирался на платформах, отличных от i386,
+ amd64, sparc и ppc; ошибка появилась в 0.5.8.
+
+ *) Исправление: при использовании временных файлов в время работы с
+ FastCGI-сервером в рабочем процессе мог произойти segmentation
+ fault; ошибка появилась в 0.5.8.
+
+ *) Исправление: если переменная $fastcgi_script_name записывалась в
+ лог, то в рабочем процессе мог произойти segmentation fault.
+
+ *) Исправление: ngx_http_perl_module не собирался на Solaris.
+
+
Изменения в nginx 0.5.11 05.02.2007
*) Добавление: теперь configure определяет библиотеку PCRE в
diff --git a/src/core/nginx.h b/src/core/nginx.h
index 5d903d23f..622bb06fe 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,7 +8,7 @@
#define _NGINX_H_INCLUDED_
-#define NGINX_VERSION "0.5.11"
+#define NGINX_VERSION "0.5.12"
#define NGINX_VER "nginx/" NGINX_VERSION
#define NGINX_VAR "NGINX"
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
index 7daebaac3..243febd0e 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -901,7 +901,8 @@ ngx_test_lockfile(u_char *file, ngx_log_t *log)
#if !(NGX_HAVE_ATOMIC_OPS)
ngx_fd_t fd;
- fd = ngx_open_file(file, NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN);
+ fd = ngx_open_file(file, NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN,
+ NGX_FILE_DEFAULT_ACCESS);
if (fd == NGX_INVALID_FILE) {
ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
diff --git a/src/core/ngx_shmtx.c b/src/core/ngx_shmtx.c
index 0d3b09616..ead94e484 100644
--- a/src/core/ngx_shmtx.c
+++ b/src/core/ngx_shmtx.c
@@ -35,7 +35,8 @@ ngx_shmtx_create(ngx_shmtx_t *mtx, void *addr, u_char *name)
ngx_shmtx_destory(mtx);
}
- mtx->fd = ngx_open_file(name, NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN);
+ mtx->fd = ngx_open_file(name, NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN,
+ NGX_FILE_DEFAULT_ACCESS);
if (mtx->fd == NGX_INVALID_FILE) {
ngx_log_error(NGX_LOG_EMERG, ngx_cycle->log, ngx_errno,
diff --git a/src/event/ngx_event_pipe.c b/src/event/ngx_event_pipe.c
index b8ff60826..31efc0323 100644
--- a/src/event/ngx_event_pipe.c
+++ b/src/event/ngx_event_pipe.c
@@ -419,6 +419,7 @@ ngx_event_pipe_read_upstream(ngx_event_pipe_t *p)
static ngx_int_t
ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)
{
+ u_char *prev;
size_t bsize;
ngx_uint_t flush, prev_last_shadow;
ngx_chain_t *out, **ll, *cl;
@@ -497,11 +498,18 @@ ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)
/* bsize is the size of the busy recycled bufs */
+ prev = NULL;
bsize = 0;
for (cl = p->busy; cl; cl = cl->next) {
+
if (cl->buf->recycled) {
+ if (prev == cl->buf->start) {
+ continue;
+ }
+
bsize += cl->buf->end - cl->buf->start;
+ prev = cl->buf->start;
}
}
@@ -509,8 +517,14 @@ ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)
"pipe write busy: %uz", bsize);
out = NULL;
- ll = NULL;
+
+ if (bsize >= (size_t) p->busy_size) {
+ flush = 1;
+ goto flush;
+ }
+
flush = 0;
+ ll = NULL;
prev_last_shadow = 1;
for ( ;; ) {
@@ -579,6 +593,8 @@ ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)
ll = &cl->next;
}
+ flush:
+
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, p->log, 0,
"pipe write: out:%p, f:%d", out, flush);
diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c
index f4c0caf02..bf104d74b 100644
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -1969,27 +1969,38 @@ ngx_http_fastcgi_script_name_variable(ngx_http_request_t *r,
u_char *p;
ngx_http_fastcgi_loc_conf_t *flcf;
- v->valid = 1;
- v->no_cachable = 0;
- v->not_found = 0;
+ if (r->uri.len) {
+ v->valid = 1;
+ v->no_cachable = 0;
+ v->not_found = 0;
- flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module);
+ flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module);
- if (r->uri.data[r->uri.len - 1] != '/') {
- v->len = r->uri.len;
- v->data = r->uri.data;
- return NGX_OK;
- }
+ if (r->uri.data[r->uri.len - 1] != '/') {
+ v->len = r->uri.len;
+ v->data = r->uri.data;
+ return NGX_OK;
+ }
- v->len = r->uri.len + flcf->index.len;
+ v->len = r->uri.len + flcf->index.len;
- v->data = ngx_palloc(r->pool, v->len);
- if (v->data == NULL) {
- return NGX_ERROR;
- }
+ v->data = ngx_palloc(r->pool, v->len);
+ if (v->data == NULL) {
+ return NGX_ERROR;
+ }
- p = ngx_copy(v->data, r->uri.data, r->uri.len);
- ngx_memcpy(p, flcf->index.data, flcf->index.len);
+ p = ngx_copy(v->data, r->uri.data, r->uri.len);
+ ngx_memcpy(p, flcf->index.data, flcf->index.len);
+
+ } else {
+ v->len = 0;
+ v->valid = 1;
+ v->no_cachable = 0;
+ v->not_found = 0;
+ v->data = NULL;
+
+ return NGX_OK;
+ }
return NGX_OK;
}
diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm
index 707307da7..fff4c60f7 100644
--- 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.11';
+our $VERSION = '0.5.12';
require XSLoader;
XSLoader::load('nginx', $VERSION);
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index d5e6dd5e6..52860006b 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1784,6 +1784,7 @@ ngx_http_upstream_process_body(ngx_event_t *ev)
{
ngx_event_pipe_t *p;
ngx_connection_t *c, *downstream;
+ ngx_http_log_ctx_t *ctx;
ngx_http_request_t *r;
ngx_http_upstream_t *u;
@@ -1801,6 +1802,9 @@ ngx_http_upstream_process_body(ngx_event_t *ev)
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http upstream process upstream");
c->log->action = "reading upstream";
+
+ ctx = c->log->data;
+ ctx->current_request = r;
}
p = u->pipe;
diff --git a/src/os/unix/ngx_solaris_config.h b/src/os/unix/ngx_solaris_config.h
index 666e5eae9..9183bb360 100644
--- a/src/os/unix/ngx_solaris_config.h
+++ b/src/os/unix/ngx_solaris_config.h
@@ -8,7 +8,9 @@
#define _NGX_SOLARIS_CONFIG_H_INCLUDED_
+#ifndef _REENTRANT
#define _REENTRANT
+#endif
#define _FILE_OFFSET_BITS 64 /* must be before <sys/types.h> */