Skip to content

deps: update nghttp2 to 1.66.0 #58786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions deps/nghttp2/lib/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@
Expand Down
2 changes: 2 additions & 0 deletions deps/nghttp2/lib/includes/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@
Expand Down
4 changes: 2 additions & 2 deletions deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
* @macro
* Version number of the nghttp2 library release
*/
#define NGHTTP2_VERSION "1.65.0"
#define NGHTTP2_VERSION "1.66.0"

/**
* @macro
* Numerical representation of the version number of the nghttp2 library
* 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 */
21 changes: 18 additions & 3 deletions deps/nghttp2/lib/nghttp2_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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) {
Expand Down
19 changes: 15 additions & 4 deletions deps/nghttp2/lib/nghttp2_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
preface handling. */
extern int nghttp2_enable_strict_preface;

extern nghttp2_stream root;
extern nghttp2_stream nghttp2_stream_root;

/*
* Option flags.
Expand Down Expand Up @@ -402,23 +402,34 @@ 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
* nghttp2_session_add_frame() to add RST_STREAM easily.
*
* 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:
*
* 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
Expand Down
2 changes: 1 addition & 1 deletion deps/nghttp2/lib/nghttp2_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion deps/nghttp2/lib/nghttp2_submit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading