Skip to content

Commit aa248e4

Browse files
nginxkolbyjack
authored andcommitted
Changes with nginx 1.7.10 10 Feb 2015
*) Feature: the "use_temp_path" parameter of the "proxy_cache_path", "fastcgi_cache_path", "scgi_cache_path", and "uwsgi_cache_path" directives. *) Feature: the $upstream_header_time variable. *) Workaround: now on disk overflow nginx tries to write error logs once a second only. *) Bugfix: the "try_files" directive did not ignore normal files while testing directories. Thanks to Damien Tournoud. *) Bugfix: alerts "sendfile() failed" if the "sendfile" directive was used on OS X; the bug had appeared in 1.7.8. *) Bugfix: alerts "sem_post() failed" might appear in logs. *) Bugfix: nginx could not be built with musl libc. Thanks to James Taylor. *) Bugfix: nginx could not be built on Tru64 UNIX. Thanks to Goetz T. Fischer.
1 parent fb7c9d5 commit aa248e4

17 files changed

+273
-57
lines changed

CHANGES

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
11

2+
Changes with nginx 1.7.10 10 Feb 2015
3+
4+
*) Feature: the "use_temp_path" parameter of the "proxy_cache_path",
5+
"fastcgi_cache_path", "scgi_cache_path", and "uwsgi_cache_path"
6+
directives.
7+
8+
*) Feature: the $upstream_header_time variable.
9+
10+
*) Workaround: now on disk overflow nginx tries to write error logs once
11+
a second only.
12+
13+
*) Bugfix: the "try_files" directive did not ignore normal files while
14+
testing directories.
15+
Thanks to Damien Tournoud.
16+
17+
*) Bugfix: alerts "sendfile() failed" if the "sendfile" directive was
18+
used on OS X; the bug had appeared in 1.7.8.
19+
20+
*) Bugfix: alerts "sem_post() failed" might appear in logs.
21+
22+
*) Bugfix: nginx could not be built with musl libc.
23+
Thanks to James Taylor.
24+
25+
*) Bugfix: nginx could not be built on Tru64 UNIX.
26+
Thanks to Goetz T. Fischer.
27+
28+
229
Changes with nginx 1.7.9 23 Dec 2014
330

431
*) Feature: variables support in the "proxy_cache", "fastcgi_cache",

CHANGES.ru

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11

2+
Изменения в nginx 1.7.10 10.02.2015
3+
4+
*) Добавление: параметр use_temp_path директив proxy_cache_path,
5+
fastcgi_cache_path, scgi_cache_path и uwsgi_cache_path.
6+
7+
*) Добавление: переменная $upstream_header_time.
8+
9+
*) Изменение: теперь при переполнении диска nginx пытается писать
10+
error_log'и только раз в секунду.
11+
12+
*) Исправление: директива try_files при тестировании каталогов не
13+
игнорировала обычные файлы.
14+
Спасибо Damien Tournoud.
15+
16+
*) Исправление: при использовании директивы sendfile на OS X возникали
17+
ошибки "sendfile() failed"; ошибка появилась в nginx 1.7.8.
18+
19+
*) Исправление: в лог могли писаться сообщения "sem_post() failed".
20+
21+
*) Исправление: nginx не собирался с musl libc.
22+
Спасибо James Taylor.
23+
24+
*) Исправление: nginx не собирался на Tru64 UNIX.
25+
Спасибо Goetz T. Fischer.
26+
27+
228
Изменения в nginx 1.7.9 23.12.2014
329
430
*) Добавление: директивы proxy_cache, fastcgi_cache, scgi_cache и

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2002-2014 Igor Sysoev
3-
* Copyright (C) 2011-2014 Nginx, Inc.
2+
* Copyright (C) 2002-2015 Igor Sysoev
3+
* Copyright (C) 2011-2015 Nginx, Inc.
44
* All rights reserved.
55
*
66
* Redistribution and use in source and binary forms, with or without

src/core/nginx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#define _NGINX_H_INCLUDED_
1010

1111

12-
#define nginx_version 1007009
13-
#define NGINX_VERSION "1.7.9"
12+
#define nginx_version 1007010
13+
#define NGINX_VERSION "1.7.10"
1414
#define NGINX_VER "nginx/" NGINX_VERSION
1515

1616
#ifdef NGX_BUILD

src/core/ngx_file.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain)
114114
rc = ngx_create_temp_file(&tf->file, tf->path, tf->pool,
115115
tf->persistent, tf->clean, tf->access);
116116

117-
if (rc == NGX_ERROR || rc == NGX_AGAIN) {
117+
if (rc != NGX_OK) {
118118
return rc;
119119
}
120120

@@ -1035,10 +1035,18 @@ ngx_walk_tree(ngx_tree_ctx_t *ctx, ngx_str_t *tree)
10351035
ctx->access = ngx_de_access(&dir);
10361036
ctx->mtime = ngx_de_mtime(&dir);
10371037

1038-
if (ctx->pre_tree_handler(ctx, &file) == NGX_ABORT) {
1038+
rc = ctx->pre_tree_handler(ctx, &file);
1039+
1040+
if (rc == NGX_ABORT) {
10391041
goto failed;
10401042
}
10411043

1044+
if (rc == NGX_DECLINED) {
1045+
ngx_log_debug1(NGX_LOG_DEBUG_CORE, ctx->log, 0,
1046+
"tree skip dir \"%s\"", file.data);
1047+
continue;
1048+
}
1049+
10421050
if (ngx_walk_tree(ctx, &file) == NGX_ABORT) {
10431051
goto failed;
10441052
}

src/core/ngx_log.c

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
9191
va_list args;
9292
#endif
9393
u_char *p, *last, *msg;
94-
u_char errstr[NGX_MAX_ERROR_STR];
94+
ssize_t n;
9595
ngx_uint_t wrote_stderr, debug_connection;
96+
u_char errstr[NGX_MAX_ERROR_STR];
9697

9798
last = errstr + NGX_MAX_ERROR_STR;
9899

@@ -150,16 +151,32 @@ ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
150151

151152
if (log->writer) {
152153
log->writer(log, level, errstr, p - errstr);
153-
log = log->next;
154-
continue;
154+
goto next;
155155
}
156156

157-
(void) ngx_write_fd(log->file->fd, errstr, p - errstr);
157+
if (ngx_time() == log->disk_full_time) {
158+
159+
/*
160+
* on FreeBSD writing to a full filesystem with enabled softupdates
161+
* may block process for much longer time than writing to non-full
162+
* filesystem, so we skip writing to a log for one second
163+
*/
164+
165+
goto next;
166+
}
167+
168+
n = ngx_write_fd(log->file->fd, errstr, p - errstr);
169+
170+
if (n == -1 && ngx_errno == NGX_ENOSPC) {
171+
log->disk_full_time = ngx_time();
172+
}
158173

159174
if (log->file->fd == ngx_stderr) {
160175
wrote_stderr = 1;
161176
}
162177

178+
next:
179+
163180
log = log->next;
164181
}
165182

src/core/ngx_log.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ struct ngx_log_s {
5353

5454
ngx_atomic_uint_t connection;
5555

56+
time_t disk_full_time;
57+
5658
ngx_log_handler_pt handler;
5759
void *data;
5860

src/core/ngx_output_chain.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in)
4545
ngx_int_t rc, last;
4646
ngx_chain_t *cl, *out, **last_out;
4747

48-
if (ctx->in == NULL && ctx->busy == NULL) {
49-
48+
if (ctx->in == NULL && ctx->busy == NULL
49+
#if (NGX_HAVE_FILE_AIO)
50+
&& !ctx->aio
51+
#endif
52+
)
53+
{
5054
/*
5155
* the short path for the case when the ctx->in and ctx->busy chains
5256
* are empty, the incoming chain is empty too or has the single buf

src/core/ngx_shmtx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ ngx_shmtx_lock(ngx_shmtx_t *mtx)
101101
(void) ngx_atomic_fetch_add(mtx->wait, 1);
102102

103103
if (*mtx->lock == 0 && ngx_atomic_cmp_set(mtx->lock, 0, ngx_pid)) {
104+
(void) ngx_atomic_fetch_add(mtx->wait, -1);
104105
return;
105106
}
106107

@@ -174,7 +175,7 @@ ngx_shmtx_wakeup(ngx_shmtx_t *mtx)
174175

175176
wait = *mtx->wait;
176177

177-
if (wait == 0) {
178+
if ((ngx_atomic_int_t) wait <= 0) {
178179
return;
179180
}
180181

@@ -258,7 +259,7 @@ ngx_shmtx_trylock(ngx_shmtx_t *mtx)
258259

259260
#if __osf__ /* Tru64 UNIX */
260261

261-
if (err == NGX_EACCESS) {
262+
if (err == NGX_EACCES) {
262263
return 0;
263264
}
264265

src/core/ngx_string.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,12 @@ ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args)
429429
case 'N':
430430
#if (NGX_WIN32)
431431
*buf++ = CR;
432-
#endif
432+
if (buf < last) {
433+
*buf++ = LF;
434+
}
435+
#else
433436
*buf++ = LF;
437+
#endif
434438
fmt++;
435439

436440
continue;

0 commit comments

Comments
 (0)