Skip to content

Commit 1b8a6b1

Browse files
author
pangpang
committed
update nginx to 1.25.2
1 parent 8bbcd19 commit 1b8a6b1

32 files changed

+721
-401
lines changed

CHANGES

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

2+
Changes with nginx 1.25.2 15 Aug 2023
3+
4+
*) Feature: path MTU discovery when using HTTP/3.
5+
6+
*) Feature: TLS_AES_128_CCM_SHA256 cipher suite support when using
7+
HTTP/3.
8+
9+
*) Change: now nginx uses appname "nginx" when loading OpenSSL
10+
configuration.
11+
12+
*) Change: now nginx does not try to load OpenSSL configuration if the
13+
--with-openssl option was used to built OpenSSL and the OPENSSL_CONF
14+
environment variable is not set.
15+
16+
*) Bugfix: in the $body_bytes_sent variable when using HTTP/3.
17+
18+
*) Bugfix: in HTTP/3.
19+
20+
221
Changes with nginx 1.25.1 13 Jun 2023
322

423
*) Feature: the "http2" directive, which enables HTTP/2 on a per-server

CHANGES.ru

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

2+
Изменения в nginx 1.25.2 15.08.2023
3+
4+
*) Добавление: path MTU discovery при использовании HTTP/3.
5+
6+
*) Добавление: поддержка шифра TLS_AES_128_CCM_SHA256 при использовании
7+
HTTP/3.
8+
9+
*) Изменение: теперь при загрузке конфигурации OpenSSL nginx использует
10+
appname "nginx".
11+
12+
*) Изменение: теперь nginx не пытается загружать конфигурацию OpenSSL,
13+
если для сборки OpenSSL использовался параметр --with-openssl и
14+
переменная окружения OPENSSL_CONF не установлена.
15+
16+
*) Исправление: в переменной $body_bytes_sent при использовании HTTP/3.
17+
18+
*) Исправление: в HTTP/3.
19+
20+
221
Изменения в nginx 1.25.1 13.06.2023
322

423
*) Добавление: директива http2, позволяющая включать HTTP/2 в отдельных

app/cpp/readme

Whitespace-only changes.

auto/lib/openssl/conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if [ $OPENSSL != NONE ]; then
88
have=NGX_OPENSSL . auto/have
99
have=NGX_SSL . auto/have
1010

11+
have=NGX_OPENSSL_NO_CONFIG . auto/have
12+
1113
if [ $USE_OPENSSL_QUIC = YES ]; then
1214
have=NGX_QUIC . auto/have
1315
have=NGX_QUIC_OPENSSL_COMPAT . auto/have

auto/options

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ HTTP_UPSTREAM_ZONE=YES
110110

111111

112112
HTTP_HI_PYTHON_VERSION=python3
113-
HTTP_HI_LUA_VERSION=lua5.3
113+
HTTP_HI_LUA_VERSION=lua5.4
114114

115115
# STUB
116116
HTTP_STUB_STATUS=NO
@@ -613,7 +613,7 @@ cat << END
613613
--with-debug enable debug logging
614614

615615
--with-http-hi-python-version with python version,python2 or python3 ,default:python3
616-
--with-http-hi-lua-versioin with lua version,lua,lua5.1,lua5.2,lua5.3 or luajit ,default:lua5.3
616+
--with-http-hi-lua-versioin with lua version,lua,lua5.1,lua5.2,lua5.3,lua5.4 or luajit ,default:lua5.4
617617

618618
END
619619

contrib/vim/syntax/nginx.vim

Lines changed: 93 additions & 124 deletions
Large diffs are not rendered by default.

install_demo.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ if ! test -f Makefile;then
1010
--with-stream_ssl_module \
1111
--with-http_realip_module \
1212
--prefix=/usr/local/nginx \
13-
--with-http-hi-python-version=python-3.8-embed \
14-
--with-http-hi-lua-version=lua5.3 \
13+
--with-http-hi-python-version=python-3.10-embed \
14+
--with-http-hi-lua-version=lua5.4 \
1515
--add-module=module/ngx_http_autoblacklist_module \
1616
--add-module=module/ngx_http_lua_module \
1717
--add-module=module/ngx_http_py_module \

module/lib/kaguya.hpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6214,9 +6214,11 @@ struct ErrorHandler {
62146214
? std::string(message)
62156215
: "unknown error running error");
62166216
#if LUA_VERSION_NUM >= 502
6217+
#if LUA_VERSION_NUM <= 503
62176218
case LUA_ERRGCMM:
62186219
throw LuaGCError(status,
62196220
message ? std::string(message) : "unknown gc error");
6221+
#endif
62206222
#endif
62216223
default:
62226224
throw LuaUnknownError(status, message ? std::string(message)
@@ -6756,7 +6758,13 @@ template <typename Derived> class LuaThreadImpl {
67566758
if (argnum < 0) {
67576759
argnum = 0;
67586760
}
6759-
int result = lua_resume(thread, state, argnum);
6761+
int nres;
6762+
int result =
6763+
#if LUA_VERSION_NUM <= 503
6764+
lua_resume(thread, state, argnum);
6765+
#else
6766+
lua_resume(thread,state,argnum,&nres);
6767+
#endif
67606768
except::checkErrorAndThrow(result, thread);
67616769
return detail::FunctionResultProxy::ReturnValue(thread, result, 1,
67626770
types::typetag<Result>());

src/core/nginx.c

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
static void ngx_show_version_info(void);
1414
static ngx_int_t ngx_add_inherited_sockets(ngx_cycle_t *cycle);
1515
static void ngx_cleanup_environment(void *data);
16+
static void ngx_cleanup_environment_variable(void *data);
1617
static ngx_int_t ngx_get_options(int argc, char *const *argv);
1718
static ngx_int_t ngx_process_options(ngx_cycle_t *cycle);
1819
static ngx_int_t ngx_save_argv(ngx_cycle_t *cycle, int argc, char *const *argv);
@@ -518,7 +519,8 @@ ngx_add_inherited_sockets(ngx_cycle_t *cycle)
518519
char **
519520
ngx_set_environment(ngx_cycle_t *cycle, ngx_uint_t *last)
520521
{
521-
char **p, **env;
522+
char **p, **env, *str;
523+
size_t len;
522524
ngx_str_t *var;
523525
ngx_uint_t i, n;
524526
ngx_core_conf_t *ccf;
@@ -600,7 +602,31 @@ ngx_set_environment(ngx_cycle_t *cycle, ngx_uint_t *last)
600602
for (i = 0; i < ccf->env.nelts; i++) {
601603

602604
if (var[i].data[var[i].len] == '=') {
603-
env[n++] = (char *) var[i].data;
605+
606+
if (last) {
607+
env[n++] = (char *) var[i].data;
608+
continue;
609+
}
610+
611+
cln = ngx_pool_cleanup_add(cycle->pool, 0);
612+
if (cln == NULL) {
613+
return NULL;
614+
}
615+
616+
len = ngx_strlen(var[i].data) + 1;
617+
618+
str = ngx_alloc(len, cycle->log);
619+
if (str == NULL) {
620+
return NULL;
621+
}
622+
623+
ngx_memcpy(str, var[i].data, len);
624+
625+
cln->handler = ngx_cleanup_environment_variable;
626+
cln->data = str;
627+
628+
env[n++] = str;
629+
604630
continue;
605631
}
606632

@@ -645,6 +671,29 @@ ngx_cleanup_environment(void *data)
645671
}
646672

647673

674+
static void
675+
ngx_cleanup_environment_variable(void *data)
676+
{
677+
char *var = data;
678+
679+
char **p;
680+
681+
for (p = environ; *p; p++) {
682+
683+
/*
684+
* if an environment variable is still used, as it happens on exit,
685+
* the only option is to leak it
686+
*/
687+
688+
if (*p == var) {
689+
return;
690+
}
691+
}
692+
693+
ngx_free(var);
694+
}
695+
696+
648697
ngx_pid_t
649698
ngx_exec_new_binary(ngx_cycle_t *cycle, char *const *argv)
650699
{

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 1025001
13-
#define NGINX_VERSION "1.25.1"
12+
#define nginx_version 1025002
13+
#define NGINX_VERSION "1.25.2"
1414
#define NGINX_VER "nginx/" NGINX_VERSION
1515

1616
#ifdef NGX_BUILD

src/core/ngx_connection.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,10 @@ ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text)
15831583
}
15841584
#endif
15851585

1586+
if (err == NGX_EMSGSIZE && c->log_error == NGX_ERROR_IGNORE_EMSGSIZE) {
1587+
return 0;
1588+
}
1589+
15861590
if (err == 0
15871591
|| err == NGX_ECONNRESET
15881592
#if (NGX_WIN32)
@@ -1600,6 +1604,7 @@ ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text)
16001604
{
16011605
switch (c->log_error) {
16021606

1607+
case NGX_ERROR_IGNORE_EMSGSIZE:
16031608
case NGX_ERROR_IGNORE_EINVAL:
16041609
case NGX_ERROR_IGNORE_ECONNRESET:
16051610
case NGX_ERROR_INFO:

src/core/ngx_connection.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ typedef enum {
9797
NGX_ERROR_ERR,
9898
NGX_ERROR_INFO,
9999
NGX_ERROR_IGNORE_ECONNRESET,
100-
NGX_ERROR_IGNORE_EINVAL
100+
NGX_ERROR_IGNORE_EINVAL,
101+
NGX_ERROR_IGNORE_EMSGSIZE
101102
} ngx_connection_log_error_e;
102103

103104

src/event/ngx_event_openssl.c

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,42 @@ int ngx_ssl_stapling_index;
140140
ngx_int_t
141141
ngx_ssl_init(ngx_log_t *log)
142142
{
143-
#if OPENSSL_VERSION_NUMBER >= 0x10100003L
143+
#if (OPENSSL_INIT_LOAD_CONFIG && !defined LIBRESSL_VERSION_NUMBER)
144+
145+
uint64_t opts;
146+
OPENSSL_INIT_SETTINGS *init;
147+
148+
opts = OPENSSL_INIT_LOAD_CONFIG;
149+
150+
#if (NGX_OPENSSL_NO_CONFIG)
151+
152+
if (getenv("OPENSSL_CONF") == NULL) {
153+
opts = OPENSSL_INIT_NO_LOAD_CONFIG;
154+
}
155+
156+
#endif
157+
158+
init = OPENSSL_INIT_new();
159+
if (init == NULL) {
160+
ngx_ssl_error(NGX_LOG_ALERT, log, 0, "OPENSSL_INIT_new() failed");
161+
return NGX_ERROR;
162+
}
144163

145-
if (OPENSSL_init_ssl(OPENSSL_INIT_LOAD_CONFIG, NULL) == 0) {
164+
#ifndef OPENSSL_NO_STDIO
165+
if (OPENSSL_INIT_set_config_appname(init, "nginx") == 0) {
166+
ngx_ssl_error(NGX_LOG_ALERT, log, 0,
167+
"OPENSSL_INIT_set_config_appname() failed");
168+
return NGX_ERROR;
169+
}
170+
#endif
171+
172+
if (OPENSSL_init_ssl(opts, init) == 0) {
146173
ngx_ssl_error(NGX_LOG_ALERT, log, 0, "OPENSSL_init_ssl() failed");
147174
return NGX_ERROR;
148175
}
149176

177+
OPENSSL_INIT_free(init);
178+
150179
/*
151180
* OPENSSL_init_ssl() may leave errors in the error queue
152181
* while returning success
@@ -156,7 +185,15 @@ ngx_ssl_init(ngx_log_t *log)
156185

157186
#else
158187

159-
OPENSSL_config(NULL);
188+
#if (NGX_OPENSSL_NO_CONFIG)
189+
190+
if (getenv("OPENSSL_CONF") == NULL) {
191+
OPENSSL_no_config();
192+
}
193+
194+
#endif
195+
196+
OPENSSL_config("nginx");
160197

161198
SSL_library_init();
162199
SSL_load_error_strings();

src/event/quic/ngx_event_quic.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,6 @@ ngx_quic_apply_transport_params(ngx_connection_t *c, ngx_quic_tp_t *ctp)
149149
ngx_log_error(NGX_LOG_INFO, c->log, 0,
150150
"quic maximum packet size is invalid");
151151
return NGX_ERROR;
152-
153-
} else if (ctp->max_udp_payload_size > ngx_quic_max_udp_payload(c)) {
154-
ctp->max_udp_payload_size = ngx_quic_max_udp_payload(c);
155-
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
156-
"quic client maximum packet size truncated");
157152
}
158153

159154
if (ctp->active_connection_id_limit < 2) {
@@ -286,7 +281,7 @@ ngx_quic_new_connection(ngx_connection_t *c, ngx_quic_conf_t *conf,
286281

287282
qc->path_validation.log = c->log;
288283
qc->path_validation.data = c;
289-
qc->path_validation.handler = ngx_quic_path_validation_handler;
284+
qc->path_validation.handler = ngx_quic_path_handler;
290285

291286
qc->conf = conf;
292287

@@ -297,7 +292,7 @@ ngx_quic_new_connection(ngx_connection_t *c, ngx_quic_conf_t *conf,
297292
ctp = &qc->ctp;
298293

299294
/* defaults to be used before actual client parameters are received */
300-
ctp->max_udp_payload_size = ngx_quic_max_udp_payload(c);
295+
ctp->max_udp_payload_size = NGX_QUIC_MAX_UDP_PAYLOAD_SIZE;
301296
ctp->ack_delay_exponent = NGX_QUIC_DEFAULT_ACK_DELAY_EXPONENT;
302297
ctp->max_ack_delay = NGX_QUIC_DEFAULT_MAX_ACK_DELAY;
303298
ctp->active_connection_id_limit = 2;
@@ -1013,7 +1008,6 @@ ngx_quic_handle_payload(ngx_connection_t *c, ngx_quic_header_t *pkt)
10131008

10141009
if (!qc->path->validated) {
10151010
qc->path->validated = 1;
1016-
qc->path->limited = 0;
10171011
ngx_quic_path_dbg(c, "in handshake", qc->path);
10181012
ngx_post_event(&qc->push, &ngx_posted_events);
10191013
}

0 commit comments

Comments
 (0)