Skip to content

Commit b8d3ceb

Browse files
committed
nginx 1.23.4
1 parent 9526873 commit b8d3ceb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1041
-181
lines changed

nginx/CHANGES

+46
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,50 @@
11

2+
Changes with nginx 1.23.4 28 Mar 2023
3+
4+
*) Change: now TLSv1.3 protocol is enabled by default.
5+
6+
*) Change: now nginx issues a warning if protocol parameters of a
7+
listening socket are redefined.
8+
9+
*) Change: now nginx closes connections with lingering if pipelining was
10+
used by the client.
11+
12+
*) Feature: byte ranges support in the ngx_http_gzip_static_module.
13+
14+
*) Bugfix: port ranges in the "listen" directive did not work; the bug
15+
had appeared in 1.23.3.
16+
Thanks to Valentin Bartenev.
17+
18+
*) Bugfix: incorrect location might be chosen to process a request if a
19+
prefix location longer than 255 characters was used in the
20+
configuration.
21+
22+
*) Bugfix: non-ASCII characters in file names on Windows were not
23+
supported by the ngx_http_autoindex_module, the ngx_http_dav_module,
24+
and the "include" directive.
25+
26+
*) Change: the logging level of the "data length too long", "length too
27+
short", "bad legacy version", "no shared signature algorithms", "bad
28+
digest length", "missing sigalgs extension", "encrypted length too
29+
long", "bad length", "bad key update", "mixed handshake and non
30+
handshake data", "ccs received early", "data between ccs and
31+
finished", "packet length too long", "too many warn alerts", "record
32+
too small", and "got a fin before a ccs" SSL errors has been lowered
33+
from "crit" to "info".
34+
35+
*) Bugfix: a socket leak might occur when using HTTP/2 and the
36+
"error_page" directive to redirect errors with code 400.
37+
38+
*) Bugfix: messages about logging to syslog errors did not contain
39+
information that the errors happened while logging to syslog.
40+
Thanks to Safar Safarly.
41+
42+
*) Workaround: "gzip filter failed to use preallocated memory" alerts
43+
appeared in logs when using zlib-ng.
44+
45+
*) Bugfix: in the mail proxy server.
46+
47+
248
Changes with nginx 1.23.3 13 Dec 2022
349

450
*) Bugfix: an error might occur when reading PROXY protocol version 2

nginx/CHANGES.ru

+47
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,51 @@
11

2+
Изменения в nginx 1.23.4 28.03.2023
3+
4+
*) Изменение: теперь протокол TLSv1.3 разрешён по умолчанию.
5+
6+
*) Изменение: теперь nginx выдаёт предупреждение при переопределении
7+
параметров listen-сокета, задающих используемые протоколы.
8+
9+
*) Изменение: теперь, если клиент использует pipelining, nginx закрывает
10+
соединения с ожиданием дополнительных данных (lingering close).
11+
12+
*) Добавление: поддержка byte ranges для ответов модуля
13+
ngx_http_gzip_static_module.
14+
15+
*) Исправление: диапазоны портов в директиве listen не работали; ошибка
16+
появилась в 1.23.3.
17+
Спасибо Валентину Бартеневу.
18+
19+
*) Исправление: для обработки запроса мог быть выбран неверный location,
20+
если в конфигурации использовался префиксный location длиннее 255
21+
символов.
22+
23+
*) Исправление: не-ASCII символы в именах файлов на Windows не
24+
поддерживались модулями ngx_http_autoindex_module и
25+
ngx_http_dav_module, а также директивой include.
26+
27+
*) Изменение: уровень логгирования ошибок SSL "data length too long",
28+
"length too short", "bad legacy version", "no shared signature
29+
algorithms", "bad digest length", "missing sigalgs extension",
30+
"encrypted length too long", "bad length", "bad key update", "mixed
31+
handshake and non handshake data", "ccs received early", "data
32+
between ccs and finished", "packet length too long", "too many warn
33+
alerts", "record too small", и "got a fin before a ccs" понижен с
34+
уровня crit до info.
35+
36+
*) Исправление: при использовании HTTP/2 и директивы error_page для
37+
перенаправления ошибок с кодом 400 могла происходить утечка сокетов.
38+
39+
*) Исправление: сообщения об ошибках записи в syslog не содержали
40+
информации о том, что ошибки происходили в процессе записи в syslog.
41+
Спасибо Safar Safarly.
42+
43+
*) Изменение: при использовании zlib-ng в логах появлялись сообщения
44+
"gzip filter failed to use preallocated memory".
45+
46+
*) Исправление: в почтовом прокси-сервере.
47+
48+
249
Изменения в nginx 1.23.3 13.12.2022
350

451
*) Исправление: при чтении заголовка протокола PROXY версии 2,

nginx/auto/cc/conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ else
117117
. auto/cc/acc
118118
;;
119119

120-
msvc*)
120+
msvc)
121121
# MSVC++ 6.0 SP2, MSVC++ Toolkit 2003
122122

123123
. auto/cc/msvc

nginx/auto/cc/msvc

+17-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
# MSVC 2015 (14.0) cl 19.00
1212

1313

14-
NGX_MSVC_VER=`$NGX_WINE $CC 2>&1 | grep 'Compiler Version' 2>&1 \
15-
| sed -e 's/^.* Version \(.*\)/\1/'`
14+
NGX_MSVC_VER=`$NGX_WINE $CC 2>&1 | grep 'C/C++.* [0-9][0-9]*\.[0-9]' 2>&1 \
15+
| sed -e 's/^.* \([0-9][0-9]*\.[0-9].*\)/\1/'`
1616

1717
echo " + cl version: $NGX_MSVC_VER"
1818

@@ -22,6 +22,21 @@ have=NGX_COMPILER value="\"cl $NGX_MSVC_VER\"" . auto/define
2222
ngx_msvc_ver=`echo $NGX_MSVC_VER | sed -e 's/^\([0-9]*\).*/\1/'`
2323

2424

25+
# detect x64 builds
26+
27+
case "$NGX_MSVC_VER" in
28+
29+
*x64)
30+
NGX_MACHINE=amd64
31+
;;
32+
33+
*)
34+
NGX_MACHINE=i386
35+
;;
36+
37+
esac
38+
39+
2540
# optimizations
2641

2742
# maximize speed, equivalent to -Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy

nginx/auto/lib/openssl/make

+14-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,24 @@ case "$CC" in
77

88
cl)
99

10+
case "$NGX_MACHINE" in
11+
12+
amd64)
13+
OPENSSL_TARGET=VC-WIN64A
14+
;;
15+
16+
*)
17+
OPENSSL_TARGET=VC-WIN32
18+
;;
19+
20+
esac
21+
1022
cat << END >> $NGX_MAKEFILE
1123

1224
$OPENSSL/openssl/include/openssl/ssl.h: $NGX_MAKEFILE
1325
\$(MAKE) -f auto/lib/openssl/makefile.msvc \
14-
OPENSSL="$OPENSSL" OPENSSL_OPT="$OPENSSL_OPT"
26+
OPENSSL="$OPENSSL" OPENSSL_OPT="$OPENSSL_OPT" \
27+
OPENSSL_TARGET="$OPENSSL_TARGET"
1528

1629
END
1730

nginx/auto/lib/openssl/makefile.msvc

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
all:
77
cd $(OPENSSL)
88

9-
perl Configure VC-WIN32 no-shared no-threads \
9+
perl Configure $(OPENSSL_TARGET) no-shared no-threads \
1010
--prefix="%cd%/openssl" \
1111
--openssldir="%cd%/openssl/ssl" \
1212
$(OPENSSL_OPT)

nginx/auto/os/linux

-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ ngx_feature="UDP_SEGMENT"
238238
ngx_feature_name="NGX_HAVE_UDP_SEGMENT"
239239
ngx_feature_run=no
240240
ngx_feature_incs="#include <sys/socket.h>
241-
#include <stdint.h>
242241
#include <netinet/udp.h>"
243242
ngx_feature_path=
244243
ngx_feature_libs=

nginx/configure

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ if test -z "$NGX_PLATFORM"; then
4444
else
4545
echo "building for $NGX_PLATFORM"
4646
NGX_SYSTEM=$NGX_PLATFORM
47+
NGX_MACHINE=i386
4748
fi
4849

4950
. auto/cc/conf

nginx/src/core/nginx.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#define _NGINX_H_INCLUDED_
1010

1111

12-
#define nginx_version 1023003
13-
#define NGINX_VERSION "1.23.3"
12+
#define nginx_version 1023004
13+
#define NGINX_VERSION "1.23.4"
1414
#define NGINX_VER "nginx/" NGINX_VERSION
1515

1616
#ifdef NGX_BUILD

nginx/src/core/ngx_conf_file.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,8 @@ ngx_conf_read_token(ngx_conf_t *cf)
544544
}
545545

546546
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
547-
"unexpected end of file, "
548-
"expecting \";\" or \"}\"");
547+
"unexpected end of file, "
548+
"expecting \";\" or \"}\"");
549549
return NGX_ERROR;
550550
}
551551

nginx/src/core/ngx_connection.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ ngx_open_listening_sockets(ngx_cycle_t *cycle)
660660
/*
661661
* on OpenVZ after suspend/resume EADDRINUSE
662662
* may be returned by listen() instead of bind(), see
663-
* https://bugzilla.openvz.org/show_bug.cgi?id=2470
663+
* https://bugs.openvz.org/browse/OVZ-5587
664664
*/
665665

666666
if (err != NGX_EADDRINUSE || !ngx_test_config) {

nginx/src/core/ngx_connection.h

+1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ struct ngx_connection_s {
172172
unsigned timedout:1;
173173
unsigned error:1;
174174
unsigned destroyed:1;
175+
unsigned pipeline:1;
175176

176177
unsigned idle:1;
177178
unsigned reusable:1;

nginx/src/core/ngx_string.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,12 @@ ngx_utf8_decode(u_char **p, size_t n)
13641364

13651365
u = **p;
13661366

1367-
if (u >= 0xf0) {
1367+
if (u >= 0xf8) {
1368+
1369+
(*p)++;
1370+
return 0xffffffff;
1371+
1372+
} else if (u >= 0xf0) {
13681373

13691374
u &= 0x07;
13701375
valid = 0xffff;

nginx/src/core/ngx_syslog.c

+42-10
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
static char *ngx_syslog_parse_args(ngx_conf_t *cf, ngx_syslog_peer_t *peer);
1919
static ngx_int_t ngx_syslog_init_peer(ngx_syslog_peer_t *peer);
2020
static void ngx_syslog_cleanup(void *data);
21+
static u_char *ngx_syslog_log_error(ngx_log_t *log, u_char *buf, size_t len);
2122

2223

2324
static char *facilities[] = {
@@ -66,6 +67,9 @@ ngx_syslog_process_conf(ngx_conf_t *cf, ngx_syslog_peer_t *peer)
6667
ngx_str_set(&peer->tag, "nginx");
6768
}
6869

70+
peer->hostname = &cf->cycle->hostname;
71+
peer->logp = &cf->cycle->new_log;
72+
6973
peer->conn.fd = (ngx_socket_t) -1;
7074

7175
peer->conn.read = &ngx_syslog_dummy_event;
@@ -243,7 +247,7 @@ ngx_syslog_add_header(ngx_syslog_peer_t *peer, u_char *buf)
243247
}
244248

245249
return ngx_sprintf(buf, "<%ui>%V %V %V: ", pri, &ngx_cached_syslog_time,
246-
&ngx_cycle->hostname, &peer->tag);
250+
peer->hostname, &peer->tag);
247251
}
248252

249253

@@ -286,15 +290,19 @@ ngx_syslog_send(ngx_syslog_peer_t *peer, u_char *buf, size_t len)
286290
{
287291
ssize_t n;
288292

293+
if (peer->log.handler == NULL) {
294+
peer->log = *peer->logp;
295+
peer->log.handler = ngx_syslog_log_error;
296+
peer->log.data = peer;
297+
peer->log.action = "logging to syslog";
298+
}
299+
289300
if (peer->conn.fd == (ngx_socket_t) -1) {
290301
if (ngx_syslog_init_peer(peer) != NGX_OK) {
291302
return NGX_ERROR;
292303
}
293304
}
294305

295-
/* log syslog socket events with valid log */
296-
peer->conn.log = ngx_cycle->log;
297-
298306
if (ngx_send) {
299307
n = ngx_send(&peer->conn, buf, len);
300308

@@ -306,7 +314,7 @@ ngx_syslog_send(ngx_syslog_peer_t *peer, u_char *buf, size_t len)
306314
if (n == NGX_ERROR) {
307315

308316
if (ngx_close_socket(peer->conn.fd) == -1) {
309-
ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_socket_errno,
317+
ngx_log_error(NGX_LOG_ALERT, &peer->log, ngx_socket_errno,
310318
ngx_close_socket_n " failed");
311319
}
312320

@@ -324,24 +332,25 @@ ngx_syslog_init_peer(ngx_syslog_peer_t *peer)
324332

325333
fd = ngx_socket(peer->server.sockaddr->sa_family, SOCK_DGRAM, 0);
326334
if (fd == (ngx_socket_t) -1) {
327-
ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_socket_errno,
335+
ngx_log_error(NGX_LOG_ALERT, &peer->log, ngx_socket_errno,
328336
ngx_socket_n " failed");
329337
return NGX_ERROR;
330338
}
331339

332340
if (ngx_nonblocking(fd) == -1) {
333-
ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_socket_errno,
341+
ngx_log_error(NGX_LOG_ALERT, &peer->log, ngx_socket_errno,
334342
ngx_nonblocking_n " failed");
335343
goto failed;
336344
}
337345

338346
if (connect(fd, peer->server.sockaddr, peer->server.socklen) == -1) {
339-
ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_socket_errno,
347+
ngx_log_error(NGX_LOG_ALERT, &peer->log, ngx_socket_errno,
340348
"connect() failed");
341349
goto failed;
342350
}
343351

344352
peer->conn.fd = fd;
353+
peer->conn.log = &peer->log;
345354

346355
/* UDP sockets are always ready to write */
347356
peer->conn.write->ready = 1;
@@ -351,7 +360,7 @@ ngx_syslog_init_peer(ngx_syslog_peer_t *peer)
351360
failed:
352361

353362
if (ngx_close_socket(fd) == -1) {
354-
ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_socket_errno,
363+
ngx_log_error(NGX_LOG_ALERT, &peer->log, ngx_socket_errno,
355364
ngx_close_socket_n " failed");
356365
}
357366

@@ -372,7 +381,30 @@ ngx_syslog_cleanup(void *data)
372381
}
373382

374383
if (ngx_close_socket(peer->conn.fd) == -1) {
375-
ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_socket_errno,
384+
ngx_log_error(NGX_LOG_ALERT, &peer->log, ngx_socket_errno,
376385
ngx_close_socket_n " failed");
377386
}
378387
}
388+
389+
390+
static u_char *
391+
ngx_syslog_log_error(ngx_log_t *log, u_char *buf, size_t len)
392+
{
393+
u_char *p;
394+
ngx_syslog_peer_t *peer;
395+
396+
p = buf;
397+
398+
if (log->action) {
399+
p = ngx_snprintf(buf, len, " while %s", log->action);
400+
len -= p - buf;
401+
}
402+
403+
peer = log->data;
404+
405+
if (peer) {
406+
p = ngx_snprintf(p, len, ", server: %V", &peer->server.name);
407+
}
408+
409+
return p;
410+
}

0 commit comments

Comments
 (0)