summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-02-05 14:02:58 +0000
committerJonathan Kolb <jon@b0g.us>2007-02-05 14:02:58 +0000
commitfddf62f830956e52d78b2ade22a8cee347e31b65 (patch)
tree35516ec66fc10bb32cff60afd3c2b4c3e9901a44
parent4335a0aa2cb4b58f9b0e79b62f5bf19d37a595a9 (diff)
downloadnginx-0.5.11.tar.gz
Changes with nginx 0.5.11 05 Feb 2007v0.5.11
*) Feature: now configure detects system PCRE library in MacPorts. Thanks to Chris McGrath. *) Bugfix: the response was incorrect if several ranges were requested; bug appeared in 0.5.6. *) Bugfix: the "create_full_put_path" directive could not create the intermediate directories if no "dav_access" directive was set. Thanks to Evan Miller. *) Bugfix: the "0" response code might be logged in the access_log instead of the "400" and "408" error codes. *) Bugfix: a segmentation fault might occur in worker process if nginx was built with -O2 optimization.
-rw-r--r--CHANGES19
-rw-r--r--CHANGES.ru21
-rw-r--r--auto/lib/pcre/conf25
-rw-r--r--src/core/nginx.h2
-rw-r--r--src/core/ngx_file.c10
-rw-r--r--src/core/ngx_times.c2
-rw-r--r--src/event/ngx_event.c3
-rw-r--r--src/http/modules/ngx_http_dav_module.c16
-rw-r--r--src/http/modules/ngx_http_memcached_module.c4
-rw-r--r--src/http/modules/ngx_http_range_filter_module.c8
-rw-r--r--src/http/modules/perl/nginx.pm2
-rw-r--r--src/http/ngx_http_request.c6
-rw-r--r--src/os/unix/ngx_files.h3
13 files changed, 95 insertions, 26 deletions
diff --git a/CHANGES b/CHANGES
index ba0cf61cd..630822591 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,23 @@
+Changes with nginx 0.5.11 05 Feb 2007
+
+ *) Feature: now configure detects system PCRE library in MacPorts.
+ Thanks to Chris McGrath.
+
+ *) Bugfix: the response was incorrect if several ranges were requested;
+ bug appeared in 0.5.6.
+
+ *) Bugfix: the "create_full_put_path" directive could not create the
+ intermediate directories if no "dav_access" directive was set.
+ Thanks to Evan Miller.
+
+ *) Bugfix: the "0" response code might be logged in the access_log
+ instead of the "400" and "408" error codes.
+
+ *) Bugfix: a segmentation fault might occur in worker process if nginx
+ was built with -O2 optimization.
+
+
Changes with nginx 0.5.10 26 Jan 2007
*) Bugfix: while online executable file upgrade the new master process
diff --git a/CHANGES.ru b/CHANGES.ru
index 043e26fc3..4c6f7edf2 100644
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,4 +1,25 @@
+Изменения в nginx 0.5.11 05.02.2007
+
+ *) Добавление: теперь configure определяет библиотеку PCRE в
+ MacPorts.
+ Спасибо Chris McGrath.
+
+ *) Исправление: ответ был неверным, если запрашивалось несколько
+ диапазонов; ошибка появилась в 0.5.6.
+
+ *) Исправление: директива create_full_put_path не могла создавать
+ промежуточные каталоги, если не была установлена директива
+ dav_access.
+ Спасибо Evan Miller.
+
+ *) Исправление: вместо кодов ошибок "400" и "408" в access_log мог
+ записываться код "0".
+
+ *) Исправление: при сборке с оптимизацией -O2 в рабочем процессе мог
+ произойти segmentation fault.
+
+
Изменения в nginx 0.5.10 26.01.2007
*) Исправление: во время обновления исполняемого файла новый процесс не
diff --git a/auto/lib/pcre/conf b/auto/lib/pcre/conf
index a1143814d..3b2ca1248 100644
--- a/auto/lib/pcre/conf
+++ b/auto/lib/pcre/conf
@@ -169,6 +169,31 @@ else
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
PCRE=YES
ngx_found=no
+
+ else
+ # MacPorts
+
+ if [ $PCRE = NO ]; then
+
+ ngx_feature="PCRE library in /opt/local/"
+ ngx_feature_name="NGX_PCRE"
+ ngx_feature_run=no
+ ngx_feature_incs="#include <pcre.h>"
+ ngx_feature_path="/opt/local/include"
+ ngx_feature_libs="-L/opt/local/lib -lpcre"
+ ngx_feature_test="pcre *re;
+ re = pcre_compile(NULL, 0, NULL, 0, NULL)"
+ . auto/feature
+ fi
+ fi
+
+ if [ $ngx_found = yes ]; then
+ CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
+ CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
+ CORE_INCS="$CORE_INCS $ngx_feature_path"
+ CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
+ PCRE=YES
+ ngx_found=no
fi
fi
diff --git a/src/core/nginx.h b/src/core/nginx.h
index 3386f5879..5d903d23f 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,7 +8,7 @@
#define _NGINX_H_INCLUDED_
-#define NGINX_VERSION "0.5.10"
+#define NGINX_VERSION "0.5.11"
#define NGINX_VER "nginx/" NGINX_VERSION
#define NGINX_VAR "NGINX"
diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c
index 876541551..cef4dc1b8 100644
--- a/src/core/ngx_file.c
+++ b/src/core/ngx_file.c
@@ -39,12 +39,12 @@ ngx_int_t
ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool,
ngx_uint_t persistent, ngx_uint_t clean, ngx_uint_t access)
{
+ uint32_t n;
ngx_err_t err;
- ngx_atomic_uint_t n;
ngx_pool_cleanup_t *cln;
ngx_pool_cleanup_file_t *clnf;
- file->name.len = path->name.len + 1 + path->len + NGX_ATOMIC_T_LEN;
+ file->name.len = path->name.len + 1 + path->len + 10;
file->name.data = ngx_palloc(pool, file->name.len + 1);
if (file->name.data == NULL) {
@@ -59,11 +59,11 @@ ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool,
ngx_memcpy(file->name.data, path->name.data, path->name.len);
- n = ngx_next_temp_number(0);
+ n = (uint32_t) ngx_next_temp_number(0);
for ( ;; ) {
(void) ngx_sprintf(file->name.data + path->name.len + 1 + path->len,
- "%0muA%Z", n);
+ "%010uD%Z", n);
ngx_create_hashed_filename(file, path);
@@ -92,7 +92,7 @@ ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool,
err = ngx_errno;
if (err == NGX_EEXIST) {
- n = ngx_next_temp_number(1);
+ n = (uint32_t) ngx_next_temp_number(1);
continue;
}
diff --git a/src/core/ngx_times.c b/src/core/ngx_times.c
index be289dd14..551e10258 100644
--- a/src/core/ngx_times.c
+++ b/src/core/ngx_times.c
@@ -87,7 +87,7 @@ ngx_time_update(time_t sec, ngx_uint_t msec)
return;
}
- if (slot == NGX_TIME_SLOTS) {
+ if (slot == NGX_TIME_SLOTS - 1) {
slot = 0;
} else {
slot++;
diff --git a/src/event/ngx_event.c b/src/event/ngx_event.c
index 563186e3e..91efde009 100644
--- a/src/event/ngx_event.c
+++ b/src/event/ngx_event.c
@@ -845,7 +845,8 @@ ngx_send_lowat(ngx_connection_t *c, size_t lowat)
sndlowat = (int) lowat;
if (setsockopt(c->fd, SOL_SOCKET, SO_SNDLOWAT,
- (const void *) &sndlowat, sizeof(int)) == -1)
+ (const void *) &sndlowat, sizeof(int))
+ == -1)
{
ngx_connection_error(c, ngx_socket_errno,
"setsockopt(SO_SNDLOWAT) failed");
diff --git a/src/http/modules/ngx_http_dav_module.c b/src/http/modules/ngx_http_dav_module.c
index 5a2f0cacb..f46cfe15d 100644
--- a/src/http/modules/ngx_http_dav_module.c
+++ b/src/http/modules/ngx_http_dav_module.c
@@ -252,7 +252,9 @@ ngx_http_dav_handler(ngx_http_request_t *r)
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http mkcol path: \"%s\"", path.data);
- if (ngx_create_dir(path.data, dlcf->access) != NGX_FILE_ERROR) {
+ if (ngx_create_dir(path.data, ngx_dir_access(dlcf->access))
+ != NGX_FILE_ERROR)
+ {
if (ngx_http_dav_location(r, path.data) != NGX_OK) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
@@ -351,7 +353,7 @@ ngx_http_dav_put_handler(ngx_http_request_t *r)
#if !(NGX_WIN32)
- if (ngx_change_file_access(temp->data, dlcf->access & ~0111)
+ if (ngx_change_file_access(temp->data, dlcf->access)
== NGX_FILE_ERROR)
{
err = ngx_errno;
@@ -393,7 +395,7 @@ ngx_http_dav_put_handler(ngx_http_request_t *r)
if (err == NGX_ENOENT) {
if (dlcf->create_full_put_path) {
- err = ngx_create_full_path(path.data, dlcf->access);
+ err = ngx_create_full_path(path.data, ngx_dir_access(dlcf->access));
if (err == 0) {
if (ngx_rename_file(temp->data, path.data) != NGX_FILE_ERROR) {
@@ -539,7 +541,7 @@ ngx_http_dav_access(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
value = cf->args->elts;
- lcf->access = 0700;
+ lcf->access = 0600;
for (i = 1; i < cf->args->nelts; i++) {
@@ -562,16 +564,16 @@ ngx_http_dav_access(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
}
if (ngx_strcmp(p, "rw") == 0) {
- right = 7;
+ right = 6;
} else if (ngx_strcmp(p, "r") == 0) {
- right = 5;
+ right = 4;
} else {
goto invalid;
}
- lcf->access += right << shift;
+ lcf->access |= right << shift;
}
return NGX_CONF_OK;
diff --git a/src/http/modules/ngx_http_memcached_module.c b/src/http/modules/ngx_http_memcached_module.c
index 8894410ab..0fee694b2 100644
--- a/src/http/modules/ngx_http_memcached_module.c
+++ b/src/http/modules/ngx_http_memcached_module.c
@@ -242,7 +242,7 @@ ngx_http_memcached_create_request(ngx_http_request_t *r)
return NGX_ERROR;
}
- len = sizeof("get ") - 1 + vv->len + sizeof(" " CRLF) - 1;
+ len = sizeof("get ") - 1 + vv->len + sizeof(CRLF) - 1;
if (vv->len) {
len += 1 + vv->len;
}
@@ -275,7 +275,7 @@ ngx_http_memcached_create_request(ngx_http_request_t *r)
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http memcached request: \"%V\"", &ctx->key);
- *b->last++ = ' '; *b->last++ = CR; *b->last++ = LF;
+ *b->last++ = CR; *b->last++ = LF;
return NGX_OK;
}
diff --git a/src/http/modules/ngx_http_range_filter_module.c b/src/http/modules/ngx_http_range_filter_module.c
index 55af30096..0c945d85f 100644
--- a/src/http/modules/ngx_http_range_filter_module.c
+++ b/src/http/modules/ngx_http_range_filter_module.c
@@ -596,13 +596,13 @@ ngx_http_range_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
b->file = buf->file;
if (buf->in_file) {
- buf->file_pos = range[i].start;
- buf->file_last = range[i].end;
+ b->file_pos = range[i].start;
+ b->file_last = range[i].end;
}
if (ngx_buf_in_memory(buf)) {
- buf->pos = buf->start + (size_t) range[i].start;
- buf->last = buf->start + (size_t) range[i].end;
+ b->pos = buf->start + (size_t) range[i].start;
+ b->last = buf->start + (size_t) range[i].end;
}
dcl = ngx_alloc_chain_link(r->pool);
diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm
index 4ba6c2a4f..707307da7 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.10';
+our $VERSION = '0.5.11';
require XSLoader;
XSLoader::load('nginx', $VERSION);
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index fb00fc988..d37fead3a 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -1496,10 +1496,8 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
|| rc == NGX_HTTP_REQUEST_TIME_OUT
|| r->connection->error)
{
- if (rc == NGX_HTTP_CLIENT_CLOSED_REQUEST
- && r->headers_out.status == 0)
- {
- r->headers_out.status = NGX_HTTP_CLIENT_CLOSED_REQUEST;
+ if (rc > 0 && r->headers_out.status == 0) {
+ r->headers_out.status = rc;
}
if (ngx_http_post_action(r) == NGX_OK) {
diff --git a/src/os/unix/ngx_files.h b/src/os/unix/ngx_files.h
index d4ad8a467..aa7311d72 100644
--- a/src/os/unix/ngx_files.h
+++ b/src/os/unix/ngx_files.h
@@ -122,6 +122,9 @@ ngx_int_t ngx_open_dir(ngx_str_t *name, ngx_dir_t *dir);
#define ngx_delete_dir_n "rmdir()"
+#define ngx_dir_access(a) (a | (a & 0444) >> 2)
+
+
#define ngx_de_name(dir) ((u_char *) (dir)->de->d_name)
#if (NGX_FREEBSD)
#define ngx_de_namelen(dir) (dir)->de->d_namlen