Skip to content

Commit

Permalink
nginx 1.25.2
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Aug 21, 2023
1 parent 8b01881 commit 51a7ff9
Show file tree
Hide file tree
Showing 28 changed files with 708 additions and 396 deletions.
19 changes: 19 additions & 0 deletions nginx/CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@

Changes with nginx 1.25.2 15 Aug 2023

*) Feature: path MTU discovery when using HTTP/3.

*) Feature: TLS_AES_128_CCM_SHA256 cipher suite support when using
HTTP/3.

*) Change: now nginx uses appname "nginx" when loading OpenSSL
configuration.

*) Change: now nginx does not try to load OpenSSL configuration if the
--with-openssl option was used to built OpenSSL and the OPENSSL_CONF
environment variable is not set.

*) Bugfix: in the $body_bytes_sent variable when using HTTP/3.

*) Bugfix: in HTTP/3.


Changes with nginx 1.25.1 13 Jun 2023

*) Feature: the "http2" directive, which enables HTTP/2 on a per-server
Expand Down
19 changes: 19 additions & 0 deletions nginx/CHANGES.ru
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@

Изменения в nginx 1.25.2 15.08.2023

*) Добавление: path MTU discovery при использовании HTTP/3.

*) Добавление: поддержка шифра TLS_AES_128_CCM_SHA256 при использовании
HTTP/3.

*) Изменение: теперь при загрузке конфигурации OpenSSL nginx использует
appname "nginx".

*) Изменение: теперь nginx не пытается загружать конфигурацию OpenSSL,
если для сборки OpenSSL использовался параметр --with-openssl и
переменная окружения OPENSSL_CONF не установлена.

*) Исправление: в переменной $body_bytes_sent при использовании HTTP/3.

*) Исправление: в HTTP/3.


Изменения в nginx 1.25.1 13.06.2023

*) Добавление: директива http2, позволяющая включать HTTP/2 в отдельных
Expand Down
2 changes: 2 additions & 0 deletions nginx/auto/lib/openssl/conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ if [ $OPENSSL != NONE ]; then
have=NGX_OPENSSL . auto/have
have=NGX_SSL . auto/have

have=NGX_OPENSSL_NO_CONFIG . auto/have

if [ $USE_OPENSSL_QUIC = YES ]; then
have=NGX_QUIC . auto/have
have=NGX_QUIC_OPENSSL_COMPAT . auto/have
Expand Down
217 changes: 93 additions & 124 deletions nginx/contrib/vim/syntax/nginx.vim

Large diffs are not rendered by default.

53 changes: 51 additions & 2 deletions nginx/src/core/nginx.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
static void ngx_show_version_info(void);
static ngx_int_t ngx_add_inherited_sockets(ngx_cycle_t *cycle);
static void ngx_cleanup_environment(void *data);
static void ngx_cleanup_environment_variable(void *data);
static ngx_int_t ngx_get_options(int argc, char *const *argv);
static ngx_int_t ngx_process_options(ngx_cycle_t *cycle);
static ngx_int_t ngx_save_argv(ngx_cycle_t *cycle, int argc, char *const *argv);
Expand Down Expand Up @@ -518,7 +519,8 @@ ngx_add_inherited_sockets(ngx_cycle_t *cycle)
char **
ngx_set_environment(ngx_cycle_t *cycle, ngx_uint_t *last)
{
char **p, **env;
char **p, **env, *str;
size_t len;
ngx_str_t *var;
ngx_uint_t i, n;
ngx_core_conf_t *ccf;
Expand Down Expand Up @@ -600,7 +602,31 @@ ngx_set_environment(ngx_cycle_t *cycle, ngx_uint_t *last)
for (i = 0; i < ccf->env.nelts; i++) {

if (var[i].data[var[i].len] == '=') {
env[n++] = (char *) var[i].data;

if (last) {
env[n++] = (char *) var[i].data;
continue;
}

cln = ngx_pool_cleanup_add(cycle->pool, 0);
if (cln == NULL) {
return NULL;
}

len = ngx_strlen(var[i].data) + 1;

str = ngx_alloc(len, cycle->log);
if (str == NULL) {
return NULL;
}

ngx_memcpy(str, var[i].data, len);

cln->handler = ngx_cleanup_environment_variable;
cln->data = str;

env[n++] = str;

continue;
}

Expand Down Expand Up @@ -645,6 +671,29 @@ ngx_cleanup_environment(void *data)
}


static void
ngx_cleanup_environment_variable(void *data)
{
char *var = data;

char **p;

for (p = environ; *p; p++) {

/*
* if an environment variable is still used, as it happens on exit,
* the only option is to leak it
*/

if (*p == var) {
return;
}
}

ngx_free(var);
}


ngx_pid_t
ngx_exec_new_binary(ngx_cycle_t *cycle, char *const *argv)
{
Expand Down
4 changes: 2 additions & 2 deletions nginx/src/core/nginx.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#define _NGINX_H_INCLUDED_


#define nginx_version 1025001
#define NGINX_VERSION "1.25.1"
#define nginx_version 1025002
#define NGINX_VERSION "1.25.2"
#define NGINX_VER "nginx/" NGINX_VERSION

#ifdef NGX_BUILD
Expand Down
5 changes: 5 additions & 0 deletions nginx/src/core/ngx_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1583,6 +1583,10 @@ ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text)
}
#endif

if (err == NGX_EMSGSIZE && c->log_error == NGX_ERROR_IGNORE_EMSGSIZE) {
return 0;
}

if (err == 0
|| err == NGX_ECONNRESET
#if (NGX_WIN32)
Expand All @@ -1600,6 +1604,7 @@ ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text)
{
switch (c->log_error) {

case NGX_ERROR_IGNORE_EMSGSIZE:
case NGX_ERROR_IGNORE_EINVAL:
case NGX_ERROR_IGNORE_ECONNRESET:
case NGX_ERROR_INFO:
Expand Down
3 changes: 2 additions & 1 deletion nginx/src/core/ngx_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ typedef enum {
NGX_ERROR_ERR,
NGX_ERROR_INFO,
NGX_ERROR_IGNORE_ECONNRESET,
NGX_ERROR_IGNORE_EINVAL
NGX_ERROR_IGNORE_EINVAL,
NGX_ERROR_IGNORE_EMSGSIZE
} ngx_connection_log_error_e;


Expand Down
43 changes: 40 additions & 3 deletions nginx/src/event/ngx_event_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,42 @@ int ngx_ssl_stapling_index;
ngx_int_t
ngx_ssl_init(ngx_log_t *log)
{
#if OPENSSL_VERSION_NUMBER >= 0x10100003L
#if (OPENSSL_INIT_LOAD_CONFIG && !defined LIBRESSL_VERSION_NUMBER)

uint64_t opts;
OPENSSL_INIT_SETTINGS *init;

opts = OPENSSL_INIT_LOAD_CONFIG;

#if (NGX_OPENSSL_NO_CONFIG)

if (getenv("OPENSSL_CONF") == NULL) {
opts = OPENSSL_INIT_NO_LOAD_CONFIG;
}

#endif

init = OPENSSL_INIT_new();
if (init == NULL) {
ngx_ssl_error(NGX_LOG_ALERT, log, 0, "OPENSSL_INIT_new() failed");
return NGX_ERROR;
}

if (OPENSSL_init_ssl(OPENSSL_INIT_LOAD_CONFIG, NULL) == 0) {
#ifndef OPENSSL_NO_STDIO
if (OPENSSL_INIT_set_config_appname(init, "nginx") == 0) {
ngx_ssl_error(NGX_LOG_ALERT, log, 0,
"OPENSSL_INIT_set_config_appname() failed");
return NGX_ERROR;
}
#endif

if (OPENSSL_init_ssl(opts, init) == 0) {
ngx_ssl_error(NGX_LOG_ALERT, log, 0, "OPENSSL_init_ssl() failed");
return NGX_ERROR;
}

OPENSSL_INIT_free(init);

/*
* OPENSSL_init_ssl() may leave errors in the error queue
* while returning success
Expand All @@ -156,7 +185,15 @@ ngx_ssl_init(ngx_log_t *log)

#else

OPENSSL_config(NULL);
#if (NGX_OPENSSL_NO_CONFIG)

if (getenv("OPENSSL_CONF") == NULL) {
OPENSSL_no_config();
}

#endif

OPENSSL_config("nginx");

SSL_library_init();
SSL_load_error_strings();
Expand Down
10 changes: 2 additions & 8 deletions nginx/src/event/quic/ngx_event_quic.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,6 @@ ngx_quic_apply_transport_params(ngx_connection_t *c, ngx_quic_tp_t *ctp)
ngx_log_error(NGX_LOG_INFO, c->log, 0,
"quic maximum packet size is invalid");
return NGX_ERROR;

} else if (ctp->max_udp_payload_size > ngx_quic_max_udp_payload(c)) {
ctp->max_udp_payload_size = ngx_quic_max_udp_payload(c);
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
"quic client maximum packet size truncated");
}

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

qc->path_validation.log = c->log;
qc->path_validation.data = c;
qc->path_validation.handler = ngx_quic_path_validation_handler;
qc->path_validation.handler = ngx_quic_path_handler;

qc->conf = conf;

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

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

if (!qc->path->validated) {
qc->path->validated = 1;
qc->path->limited = 0;
ngx_quic_path_dbg(c, "in handshake", qc->path);
ngx_post_event(&qc->push, &ngx_posted_events);
}
Expand Down
Loading

0 comments on commit 51a7ff9

Please sign in to comment.