summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-04-01 13:20:40 +0000
committerJonathan Kolb <jon@b0g.us>2009-04-01 13:20:40 +0000
commit86822eb4dee8049aece5abb868313798c74ec9a5 (patch)
tree63bc3baa6748f4c6c15d181214e70fd235f4c439
parentfff3fa4461c4a852fa1d914765b3e850b82e6189 (diff)
downloadnginx-86822eb4dee8049aece5abb868313798c74ec9a5.tar.gz
Changes with nginx 0.7.47 01 Apr 2009v0.7.47
*) Bugfix: nginx could not be built on FreeBSD 6 and early versions; the bug had appeared in 0.7.46. *) Bugfix: nginx could not be built on MacOSX; the bug had appeared in 0.7.46. *) Bugfix: if the "max_size" parameter was set, then the cache manager might purge a whole cache; the bug had appeared in 0.7.46. *) Change: a segmentation fault might occur in worker process, if the "proxy_cache"/"fastcgi_cache" and the "proxy_cache_valid"/ "fastcgi_cache_valid" were set on different levels; the bug had appeared in 0.7.46. *) Bugfix: a segmentation fault might occur in worker process, if a request was redirected to a proxied or FastCGI server via error_page or try_files; the bug had appeared in 0.7.44.
-rw-r--r--CHANGES25
-rw-r--r--CHANGES.ru20
-rw-r--r--auto/cc/msvc16
-rw-r--r--auto/headers1
-rw-r--r--auto/include1
-rw-r--r--auto/os/features3
-rw-r--r--src/core/nginx.h4
-rw-r--r--src/core/ngx_cycle.c10
-rw-r--r--src/core/ngx_log.c14
-rw-r--r--src/core/ngx_open_file_cache.c3
-rw-r--r--src/http/modules/perl/nginx.pm2
-rw-r--r--src/http/ngx_http_file_cache.c8
-rw-r--r--src/http/ngx_http_parse.c2
-rw-r--r--src/os/unix/ngx_darwin_config.h1
-rw-r--r--src/os/unix/ngx_errno.h1
-rw-r--r--src/os/unix/ngx_files.h2
-rw-r--r--src/os/unix/ngx_freebsd_config.h2
17 files changed, 82 insertions, 33 deletions
diff --git a/CHANGES b/CHANGES
index fa743a776..2e005c25d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,25 @@
+Changes with nginx 0.7.47 01 Apr 2009
+
+ *) Bugfix: nginx could not be built on FreeBSD 6 and early versions;
+ the bug had appeared in 0.7.46.
+
+ *) Bugfix: nginx could not be built on MacOSX; the bug had
+ appeared in 0.7.46.
+
+ *) Bugfix: if the "max_size" parameter was set, then the cache manager
+ might purge a whole cache; the bug had appeared in 0.7.46.
+
+ *) Change: a segmentation fault might occur in worker process, if the
+ "proxy_cache"/"fastcgi_cache" and the "proxy_cache_valid"/
+ "fastcgi_cache_valid" were set on different levels; the bug had
+ appeared in 0.7.46.
+
+ *) Bugfix: a segmentation fault might occur in worker process, if a
+ request was redirected to a proxied or FastCGI server via error_page
+ or try_files; the bug had appeared in 0.7.44.
+
+
Changes with nginx 0.7.46 30 Mar 2009
*) Bugfix: the previous release tarball was incorrect.
@@ -6,8 +27,8 @@ Changes with nginx 0.7.46 30 Mar 2009
Changes with nginx 0.7.45 30 Mar 2009
- *) Change: now the "proxy_cache" and the "proxy_cache_valid" can be set
- on different levels.
+ *) Change: now the "proxy_cache" and the "proxy_cache_valid" directives
+ can be set on different levels.
*) Change: the "clean_time" parameter of the "proxy_cache_path"
directive is canceled.
diff --git a/CHANGES.ru b/CHANGES.ru
index 52f16c805..71f8368ba 100644
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,4 +1,24 @@
+Изменения в nginx 0.7.47 01.04.2009
+
+ *) Исправление: nginx не собирался на FreeBSD 6 и более ранних версиях;
+ ошибка появилась в 0.7.46.
+
+ *) Исправление: nginx не собирался на MacOSX; ошибка появилась в 0.7.46.
+
+ *) Исправление: если использовался параметр max_size, то cache manager
+ мог удалить весь кэш; ошибка появилась в 0.7.46.
+
+ *) Изменение: в рабочем процессе мог произойти segmentation fault, если
+ директивы proxy_cache/fastcgi_cache и proxy_cache_valid/
+ fastcgi_cache_valid не были заданы на одном уровне; ошибка появилась
+ в 0.7.46.
+
+ *) Исправление: в рабочем процессе мог произойти segmentation fault при
+ перенаправлении запроса проксированному или FastCGI-серверу с
+ помощью error_page или try_files; ошибка появилась в 0.7.44.
+
+
Изменения в nginx 0.7.46 30.03.2009
*) Исправление: архив предыдущего релиза был неверным.
diff --git a/auto/cc/msvc b/auto/cc/msvc
index 96c64c80a..f99fdd40e 100644
--- a/auto/cc/msvc
+++ b/auto/cc/msvc
@@ -2,7 +2,9 @@
# Copyright (C) Igor Sysoev
-# MSVC 6.0 SP2, MSVC Toolkit 2003 (7.1), MSVC 2005 Express Edition SP1 (8.0)
+# MSVC 6.0 SP2
+# MSVC Toolkit 2003 (7.1)
+# MSVC 2005 Express Edition SP1 (8.0)
# optimizations
@@ -76,13 +78,11 @@ LINK="\$(CC)"
# the link flags
CORE_LINK="$CORE_LINK -link -verbose:lib"
-if [ $NGX_CC_NAME = msvc7 ]; then
- # link with libcmt.lib, multithreaded
- LIBC="-MT"
-else
- # link with msvcrt.dll
- LIBC="-MD"
-fi
+# link with libcmt.lib, multithreaded
+LIBC="-MT"
+# link with msvcrt.dll
+# however, MSVC Toolkit 2003 has no MSVCRT.LIB
+#LIBC="-MD"
CFLAGS="$CFLAGS $LIBC"
diff --git a/auto/headers b/auto/headers
index cdd5d294b..6f5225f81 100644
--- a/auto/headers
+++ b/auto/headers
@@ -6,6 +6,7 @@ ngx_include="unistd.h"; . auto/include
ngx_include="inttypes.h"; . auto/include
ngx_include="limits.h"; . auto/include
ngx_include="sys/filio.h"; . auto/include
+ngx_include="sys/param.h"; . auto/include
ngx_include="sys/mount.h"; . auto/include
ngx_include="sys/statvfs.h"; . auto/include
ngx_include="crypt.h"; . auto/include
diff --git a/auto/include b/auto/include
index 4139238ca..3a047d303 100644
--- a/auto/include
+++ b/auto/include
@@ -16,6 +16,7 @@ ngx_found=no
cat << END > $NGX_AUTOTEST.c
+$NGX_INCLUDE_SYS_PARAM_H
#include <$ngx_include>
int main() {
diff --git a/auto/os/features b/auto/os/features
index f00663c88..3a9e1e98d 100644
--- a/auto/os/features
+++ b/auto/os/features
@@ -210,7 +210,8 @@ ngx_feature_test="directio(0, DIRECTIO_ON);"
ngx_feature="statfs()"
ngx_feature_name="NGX_HAVE_STATFS"
ngx_feature_run=no
-ngx_feature_incs="$NGX_INCLUDE_SYS_MOUNT_H
+ngx_feature_incs="$NGX_INCLUDE_SYS_PARAM_H
+ $NGX_INCLUDE_SYS_MOUNT_H
$NGX_INCLUDE_SYS_VFS_H"
ngx_feature_path=
ngx_feature_libs=
diff --git a/src/core/nginx.h b/src/core/nginx.h
index 44ab4c92c..aeb6f4d2d 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,8 +8,8 @@
#define _NGINX_H_INCLUDED_
-#define nginx_version 007046
-#define NGINX_VERSION "0.7.46"
+#define nginx_version 007047
+#define NGINX_VERSION "0.7.47"
#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 f3dc8619b..d566f850c 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -359,8 +359,9 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
continue;
}
- file[i].fd = ngx_open_file(file[i].name.data, NGX_FILE_RDWR,
- NGX_FILE_CREATE_OR_OPEN|NGX_FILE_APPEND,
+ file[i].fd = ngx_open_file(file[i].name.data,
+ NGX_FILE_APPEND,
+ NGX_FILE_CREATE_OR_OPEN,
NGX_FILE_DEFAULT_ACCESS);
ngx_log_debug3(NGX_LOG_DEBUG_CORE, log, 0,
@@ -1064,9 +1065,8 @@ ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user)
file[i].pos = file[i].buffer;
}
- fd = ngx_open_file(file[i].name.data, NGX_FILE_RDWR,
- NGX_FILE_CREATE_OR_OPEN|NGX_FILE_APPEND,
- NGX_FILE_DEFAULT_ACCESS);
+ fd = ngx_open_file(file[i].name.data, NGX_FILE_APPEND,
+ NGX_FILE_CREATE_OR_OPEN, NGX_FILE_DEFAULT_ACCESS);
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
"reopen file \"%s\", old:%d new:%d",
diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c
index f39f70f93..f1718f185 100644
--- a/src/core/ngx_log.c
+++ b/src/core/ngx_log.c
@@ -200,8 +200,10 @@ ngx_log_init(void)
ngx_stderr_fileno = GetStdHandle(STD_ERROR_HANDLE);
- ngx_stderr.fd = ngx_open_file(NGX_ERROR_LOG_PATH, NGX_FILE_RDWR,
- NGX_FILE_CREATE_OR_OPEN|NGX_FILE_APPEND, 0);
+ ngx_stderr.fd = ngx_open_file((u_char *) NGX_ERROR_LOG_PATH,
+ NGX_FILE_APPEND,
+ NGX_FILE_CREATE_OR_OPEN,
+ NGX_FILE_DEFAULT_ACCESS);
if (ngx_stderr.fd == NGX_INVALID_FILE) {
ngx_message_box("nginx", MB_OK, ngx_errno,
@@ -210,14 +212,6 @@ ngx_log_init(void)
return NULL;
}
- if (ngx_file_append_mode(ngx_stderr.fd) == NGX_ERROR) {
- ngx_message_box("nginx", MB_OK, ngx_errno,
- "Could not open error log file: "
- ngx_file_append_mode_n " \"" NGX_ERROR_LOG_PATH
- "\" failed");
- return NULL;
- }
-
#else
ngx_stderr.fd = STDERR_FILENO;
diff --git a/src/core/ngx_open_file_cache.c b/src/core/ngx_open_file_cache.c
index 60a8368be..cb7073675 100644
--- a/src/core/ngx_open_file_cache.c
+++ b/src/core/ngx_open_file_cache.c
@@ -466,8 +466,7 @@ ngx_open_and_stat_file(u_char *name, ngx_open_file_info_t *of, ngx_log_t *log)
fd = ngx_open_file(name, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0);
} else {
- fd = ngx_open_file(name, NGX_FILE_RDWR,
- NGX_FILE_CREATE_OR_OPEN|NGX_FILE_APPEND,
+ fd = ngx_open_file(name, NGX_FILE_APPEND, NGX_FILE_CREATE_OR_OPEN,
NGX_FILE_DEFAULT_ACCESS);
}
diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm
index 13dff8d4a..e8dbff9b2 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.7.46';
+our $VERSION = '0.7.47';
require XSLoader;
XSLoader::load('nginx', $VERSION);
diff --git a/src/http/ngx_http_file_cache.c b/src/http/ngx_http_file_cache.c
index 78f4773fc..d000a9d14 100644
--- a/src/http/ngx_http_file_cache.c
+++ b/src/http/ngx_http_file_cache.c
@@ -448,6 +448,7 @@ renew:
fcn->valid_sec = 0;
fcn->uniq = 0;
fcn->body_start = 0;
+ fcn->length = 0;
done:
@@ -1065,6 +1066,9 @@ ngx_http_file_cache_manager(void *data)
ngx_shmtx_unlock(&cache->shpool->mutex);
+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
+ "http file cache size: %O", size);
+
if (size < cache->max_size) {
return next;
}
@@ -1290,6 +1294,10 @@ ngx_http_file_cache_valid(ngx_array_t *cache_valid, ngx_uint_t status)
ngx_uint_t i;
ngx_http_cache_valid_t *valid;
+ if (cache_valid == NULL) {
+ return 0;
+ }
+
valid = cache_valid->elts;
for (i = 0; i < cache_valid->nelts; i++) {
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index 87b65395b..49f536a85 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -1534,6 +1534,8 @@ ngx_http_split_args(ngx_http_request_t *r, ngx_str_t *uri, ngx_str_t *args)
last = p + uri->len;
+ args->len = 0;
+
while (p < last) {
ch = *p++;
diff --git a/src/os/unix/ngx_darwin_config.h b/src/os/unix/ngx_darwin_config.h
index 373ed14e3..39009768f 100644
--- a/src/os/unix/ngx_darwin_config.h
+++ b/src/os/unix/ngx_darwin_config.h
@@ -24,6 +24,7 @@
#include <grp.h>
#include <dirent.h>
#include <glob.h>
+#include <sys/mount.h> /* statfs() */
#include <sys/filio.h> /* FIONBIO */
#include <sys/ioctl.h>
diff --git a/src/os/unix/ngx_errno.h b/src/os/unix/ngx_errno.h
index 967e15dec..3dbfa227e 100644
--- a/src/os/unix/ngx_errno.h
+++ b/src/os/unix/ngx_errno.h
@@ -44,6 +44,7 @@ typedef int ngx_err_t;
#define NGX_EHOSTUNREACH EHOSTUNREACH
#define NGX_ENOSYS ENOSYS
#define NGX_ECANCELED ECANCELED
+#define NGX_EILSEQ EILSEQ
#define NGX_ENOMOREFILES 0
diff --git a/src/os/unix/ngx_files.h b/src/os/unix/ngx_files.h
index dcd14c35f..982ab12b3 100644
--- a/src/os/unix/ngx_files.h
+++ b/src/os/unix/ngx_files.h
@@ -64,7 +64,7 @@ typedef struct {
#define NGX_FILE_CREATE_OR_OPEN O_CREAT
#define NGX_FILE_OPEN 0
#define NGX_FILE_TRUNCATE O_TRUNC
-#define NGX_FILE_APPEND O_APPEND
+#define NGX_FILE_APPEND O_WRONLY|O_APPEND
#define NGX_FILE_DEFAULT_ACCESS 0644
#define NGX_FILE_OWNER_ACCESS 0600
diff --git a/src/os/unix/ngx_freebsd_config.h b/src/os/unix/ngx_freebsd_config.h
index 377148602..997581a6b 100644
--- a/src/os/unix/ngx_freebsd_config.h
+++ b/src/os/unix/ngx_freebsd_config.h
@@ -22,6 +22,7 @@
#include <grp.h>
#include <dirent.h>
#include <glob.h>
+#include <sys/param.h> /* ALIGN() */
#include <sys/mount.h> /* statfs() */
#include <sys/filio.h> /* FIONBIO */
@@ -44,7 +45,6 @@
#include <libutil.h> /* setproctitle() before 4.1 */
#include <osreldate.h>
#include <sys/sysctl.h>
-#include <sys/param.h> /* ALIGN() */
#if __FreeBSD_version < 400017