diff --git a/deps/nghttp2/lib/Makefile.in b/deps/nghttp2/lib/Makefile.in index 14686ef14b1..7a4cb5e9740 100644 --- a/deps/nghttp2/lib/Makefile.in +++ b/deps/nghttp2/lib/Makefile.in @@ -360,6 +360,8 @@ LIBNGHTTP3_LIBS = @LIBNGHTTP3_LIBS@ LIBNGTCP2_CFLAGS = @LIBNGTCP2_CFLAGS@ LIBNGTCP2_CRYPTO_BORINGSSL_CFLAGS = @LIBNGTCP2_CRYPTO_BORINGSSL_CFLAGS@ LIBNGTCP2_CRYPTO_BORINGSSL_LIBS = @LIBNGTCP2_CRYPTO_BORINGSSL_LIBS@ +LIBNGTCP2_CRYPTO_OSSL_CFLAGS = @LIBNGTCP2_CRYPTO_OSSL_CFLAGS@ +LIBNGTCP2_CRYPTO_OSSL_LIBS = @LIBNGTCP2_CRYPTO_OSSL_LIBS@ LIBNGTCP2_CRYPTO_QUICTLS_CFLAGS = @LIBNGTCP2_CRYPTO_QUICTLS_CFLAGS@ LIBNGTCP2_CRYPTO_QUICTLS_LIBS = @LIBNGTCP2_CRYPTO_QUICTLS_LIBS@ LIBNGTCP2_CRYPTO_WOLFSSL_CFLAGS = @LIBNGTCP2_CRYPTO_WOLFSSL_CFLAGS@ diff --git a/deps/nghttp2/lib/includes/Makefile.in b/deps/nghttp2/lib/includes/Makefile.in index 778dcb874c9..7504f8e7c75 100644 --- a/deps/nghttp2/lib/includes/Makefile.in +++ b/deps/nghttp2/lib/includes/Makefile.in @@ -265,6 +265,8 @@ LIBNGHTTP3_LIBS = @LIBNGHTTP3_LIBS@ LIBNGTCP2_CFLAGS = @LIBNGTCP2_CFLAGS@ LIBNGTCP2_CRYPTO_BORINGSSL_CFLAGS = @LIBNGTCP2_CRYPTO_BORINGSSL_CFLAGS@ LIBNGTCP2_CRYPTO_BORINGSSL_LIBS = @LIBNGTCP2_CRYPTO_BORINGSSL_LIBS@ +LIBNGTCP2_CRYPTO_OSSL_CFLAGS = @LIBNGTCP2_CRYPTO_OSSL_CFLAGS@ +LIBNGTCP2_CRYPTO_OSSL_LIBS = @LIBNGTCP2_CRYPTO_OSSL_LIBS@ LIBNGTCP2_CRYPTO_QUICTLS_CFLAGS = @LIBNGTCP2_CRYPTO_QUICTLS_CFLAGS@ LIBNGTCP2_CRYPTO_QUICTLS_LIBS = @LIBNGTCP2_CRYPTO_QUICTLS_LIBS@ LIBNGTCP2_CRYPTO_WOLFSSL_CFLAGS = @LIBNGTCP2_CRYPTO_WOLFSSL_CFLAGS@ diff --git a/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h b/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h index 1302eb57bc5..776c4924276 100644 --- a/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h +++ b/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h @@ -29,7 +29,7 @@ * @macro * Version number of the nghttp2 library release */ -#define NGHTTP2_VERSION "1.65.0" +#define NGHTTP2_VERSION "1.66.0" /** * @macro @@ -37,6 +37,6 @@ * release. This is a 24 bit number with 8 bits for major number, 8 bits * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. */ -#define NGHTTP2_VERSION_NUM 0x014100 +#define NGHTTP2_VERSION_NUM 0x014200 #endif /* NGHTTP2VER_H */ diff --git a/deps/nghttp2/lib/nghttp2_session.c b/deps/nghttp2/lib/nghttp2_session.c index f5bda333f83..dc1a00cf576 100644 --- a/deps/nghttp2/lib/nghttp2_session.c +++ b/deps/nghttp2/lib/nghttp2_session.c @@ -41,7 +41,7 @@ #include "nghttp2_debug.h" #include "nghttp2_submit.h" -nghttp2_stream root; +nghttp2_stream nghttp2_stream_root; /* * Returns non-zero if the number of outgoing opened streams is larger @@ -1092,6 +1092,15 @@ int nghttp2_session_add_item(nghttp2_session *session, int nghttp2_session_add_rst_stream(nghttp2_session *session, int32_t stream_id, uint32_t error_code) { + return nghttp2_session_add_rst_stream_continue( + session, stream_id, error_code, + /* continue_without_stream = */ 1); +} + +int nghttp2_session_add_rst_stream_continue(nghttp2_session *session, + int32_t stream_id, + uint32_t error_code, + int continue_without_stream) { int rv; nghttp2_outbound_item *item; nghttp2_frame *frame; @@ -1148,6 +1157,12 @@ int nghttp2_session_add_rst_stream(nghttp2_session *session, int32_t stream_id, } } + /* To keep the old behaviour, do not fail if stream was not + found. */ + if (!continue_without_stream && !stream) { + return 0; + } + item = nghttp2_mem_malloc(mem, sizeof(nghttp2_outbound_item)); if (item == NULL) { return NGHTTP2_ERR_NOMEM; @@ -7715,7 +7730,7 @@ int32_t nghttp2_session_get_last_proc_stream_id(nghttp2_session *session) { nghttp2_stream *nghttp2_session_find_stream(nghttp2_session *session, int32_t stream_id) { if (stream_id == 0) { - return &root; + return &nghttp2_stream_root; } return nghttp2_session_get_stream_raw(session, stream_id); @@ -7724,7 +7739,7 @@ nghttp2_stream *nghttp2_session_find_stream(nghttp2_session *session, nghttp2_stream *nghttp2_session_get_root_stream(nghttp2_session *session) { (void)session; - return &root; + return &nghttp2_stream_root; } int nghttp2_session_check_server_session(nghttp2_session *session) { diff --git a/deps/nghttp2/lib/nghttp2_session.h b/deps/nghttp2/lib/nghttp2_session.h index 6a54d35fcab..419d23b5a96 100644 --- a/deps/nghttp2/lib/nghttp2_session.h +++ b/deps/nghttp2/lib/nghttp2_session.h @@ -45,7 +45,7 @@ preface handling. */ extern int nghttp2_enable_strict_preface; -extern nghttp2_stream root; +extern nghttp2_stream nghttp2_stream_root; /* * Option flags. @@ -402,6 +402,13 @@ int nghttp2_session_is_my_stream_id(nghttp2_session *session, int nghttp2_session_add_item(nghttp2_session *session, nghttp2_outbound_item *item); +/* + * This function wraps around nghttp2_session_add_rst_stream_continue + * with continue_without_stream = 1. + */ +int nghttp2_session_add_rst_stream(nghttp2_session *session, int32_t stream_id, + uint32_t error_code); + /* * Adds RST_STREAM frame for the stream |stream_id| with the error * code |error_code|. This is a convenient function built on top of @@ -409,7 +416,9 @@ int nghttp2_session_add_item(nghttp2_session *session, * * This function simply returns 0 without adding RST_STREAM frame if * given stream is in NGHTTP2_STREAM_CLOSING state, because multiple - * RST_STREAM for a stream is redundant. + * RST_STREAM for a stream is redundant. It also returns 0 without + * adding the frame if |continue_without_stream| is nonzero, and + * stream was already gone. * * This function returns 0 if it succeeds, or one of the following * negative error codes: @@ -417,8 +426,10 @@ int nghttp2_session_add_item(nghttp2_session *session, * NGHTTP2_ERR_NOMEM * Out of memory. */ -int nghttp2_session_add_rst_stream(nghttp2_session *session, int32_t stream_id, - uint32_t error_code); +int nghttp2_session_add_rst_stream_continue(nghttp2_session *session, + int32_t stream_id, + uint32_t error_code, + int continue_without_stream); /* * Adds PING frame. This is a convenient function built on top of diff --git a/deps/nghttp2/lib/nghttp2_stream.c b/deps/nghttp2/lib/nghttp2_stream.c index afbd7c2d9e0..0f2d3658775 100644 --- a/deps/nghttp2/lib/nghttp2_stream.c +++ b/deps/nghttp2/lib/nghttp2_stream.c @@ -151,7 +151,7 @@ void nghttp2_stream_promise_fulfilled(nghttp2_stream *stream) { } nghttp2_stream_proto_state nghttp2_stream_get_state(nghttp2_stream *stream) { - if (stream == &root) { + if (stream == &nghttp2_stream_root) { return NGHTTP2_STREAM_STATE_IDLE; } diff --git a/deps/nghttp2/lib/nghttp2_submit.c b/deps/nghttp2/lib/nghttp2_submit.c index d481aebde22..5c6390fa759 100644 --- a/deps/nghttp2/lib/nghttp2_submit.c +++ b/deps/nghttp2/lib/nghttp2_submit.c @@ -185,7 +185,8 @@ int nghttp2_submit_rst_stream(nghttp2_session *session, uint8_t flags, return NGHTTP2_ERR_INVALID_ARGUMENT; } - return nghttp2_session_add_rst_stream(session, stream_id, error_code); + return nghttp2_session_add_rst_stream_continue( + session, stream_id, error_code, /* continue_without_stream = */ 0); } int nghttp2_submit_goaway(nghttp2_session *session, uint8_t flags,