Skip to content
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

Bump nghttp2 to 1.42.0 #14730

Merged
merged 2 commits into from
Jan 17, 2021
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
80 changes: 5 additions & 75 deletions bazel/foreign_cc/nghttp2.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 35c77d1d..47bd63f5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -273,7 +273,11 @@ check_type_size("ssize_t" SIZEOF_SSIZE_T)
diff -u -r a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt 2020-11-23 08:59:08.000000000 -0600
+++ b/CMakeLists.txt 2021-01-15 17:15:43.665745800 -0600
@@ -271,7 +271,11 @@
if(SIZEOF_SSIZE_T STREQUAL "")
# ssize_t is a signed type in POSIX storing at least -1.
# Set it to "int" to match the behavior of AC_TYPE_SSIZE_T (autotools).
Expand All @@ -15,73 +14,4 @@ index 35c77d1d..47bd63f5 100644
endif()
# AC_TYPE_UINT8_T
# AC_TYPE_UINT16_T
# https://github.com/nghttp2/nghttp2/pull/1468
diff --git a/lib/nghttp2_buf.c b/lib/nghttp2_buf.c
index 2a435bebf..92f97f7f2 100644
--- a/lib/nghttp2_buf.c
+++ b/lib/nghttp2_buf.c
@@ -82,8 +82,10 @@ void nghttp2_buf_reset(nghttp2_buf *buf) {
}

void nghttp2_buf_wrap_init(nghttp2_buf *buf, uint8_t *begin, size_t len) {
- buf->begin = buf->pos = buf->last = buf->mark = begin;
- buf->end = begin + len;
+ buf->begin = buf->pos = buf->last = buf->mark = buf->end = begin;
+ if (buf->end != NULL) {
+ buf->end += len;
+ }
}

static int buf_chain_new(nghttp2_buf_chain **chain, size_t chunk_length,
diff --git a/lib/nghttp2_frame.c b/lib/nghttp2_frame.c
index 4821de408..940c723b0 100644
--- a/lib/nghttp2_frame.c
+++ b/lib/nghttp2_frame.c
@@ -818,8 +818,10 @@ int nghttp2_frame_unpack_origin_payload(nghttp2_extension *frame,
size_t len = 0;

origin = frame->payload;
- p = payload;
- end = p + payloadlen;
+ p = end = payload;
+ if (end != NULL) {
+ end += payloadlen;
+ }

for (; p != end;) {
if (end - p < 2) {
diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c
index 563ccd7de..794f141a1 100644
--- a/lib/nghttp2_session.c
+++ b/lib/nghttp2_session.c
@@ -5349,7 +5349,7 @@ static ssize_t inbound_frame_effective_readlen(nghttp2_inbound_frame *iframe,

ssize_t nghttp2_session_mem_recv(nghttp2_session *session, const uint8_t *in,
size_t inlen) {
- const uint8_t *first = in, *last = in + inlen;
+ const uint8_t *first = in, *last = in;
nghttp2_inbound_frame *iframe = &session->iframe;
size_t readlen;
ssize_t padlen;
@@ -5360,6 +5360,10 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, const uint8_t *in,
size_t pri_fieldlen;
nghttp2_mem *mem;

+ if (in != NULL) {
+ last += inlen;
+ }
+
DEBUGF("recv: connection recv_window_size=%d, local_window=%d\n",
session->recv_window_size, session->local_window_size);

@@ -5389,7 +5393,9 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, const uint8_t *in,
}

iframe->payloadleft -= readlen;
- in += readlen;
+ if (in != NULL) {
+ in += readlen;
+ }

if (iframe->payloadleft == 0) {
session_inbound_frame_reset(session);
Only in b: CMakeLists.txt.orig
3 changes: 1 addition & 2 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,7 @@ def _com_github_nghttp2_nghttp2():
name = "com_github_nghttp2_nghttp2",
build_file_content = BUILD_ALL_CONTENT,
patch_args = ["-p1"],
# This patch cannot be picked up due to ABI rules. Better
# solve is likely at the next version-major. Discussion at;
# This patch cannot be picked up due to ABI rules. Discussion at;
# https://github.com/nghttp2/nghttp2/pull/1395
# https://github.com/envoyproxy/envoy/pull/8572#discussion_r334067786
patches = ["@envoy//bazel/foreign_cc:nghttp2.patch"],
Expand Down
6 changes: 3 additions & 3 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@ REPOSITORY_LOCATIONS_SPEC = dict(
project_name = "Nghttp2",
project_desc = "Implementation of HTTP/2 and its header compression algorithm HPACK in Cimplementation of HTTP/2 and its header compression algorithm HPACK in C",
project_url = "https://nghttp2.org",
version = "1.41.0",
sha256 = "eacc6f0f8543583ecd659faf0a3f906ed03826f1d4157b536b4b385fe47c5bb8",
version = "1.42.0",
sha256 = "884d18a0158908125d58b1b61d475c0325e5a004e3d61a56b5fcc55d5f4b7af5",
strip_prefix = "nghttp2-{version}",
urls = ["https://github.com/nghttp2/nghttp2/releases/download/v{version}/nghttp2-{version}.tar.gz"],
use_category = ["controlplane", "dataplane_core"],
release_date = "2020-06-02",
release_date = "2020-11-23",
cpe = "cpe:2.3:a:nghttp2:nghttp2:*",
),
io_opentracing_cpp = dict(
Expand Down