diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index 8341f4832ec7b..a738127058bc9 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -83,6 +83,18 @@ envoy_cc_test_library( deps = [":http2_platform"], ) +envoy_cc_library( + name = "http2_event_forwarder", + srcs = ["quiche/http2/adapter/event_forwarder.cc"], + hdrs = ["quiche/http2/adapter/event_forwarder.h"], + copts = quiche_copts, + repository = "@envoy", + deps = [ + ":quiche_common_platform_export", + ":spdy_core_http2_deframer_lib", + ], +) + envoy_cc_library( name = "http2_adapter", srcs = [ @@ -129,6 +141,7 @@ envoy_cc_library( deps = [ ":http2_core_http2_trace_logging_lib", ":http2_core_priority_write_scheduler_lib", + ":http2_event_forwarder", ":spdy_core_framer_lib", ":spdy_core_header_block_lib", ":spdy_core_http2_deframer_lib", diff --git a/bazel/external/quiche.patch b/bazel/external/quiche.patch index 9a07b463b2aeb..8d9666a9adeb4 100644 --- a/bazel/external/quiche.patch +++ b/bazel/external/quiche.patch @@ -67,6 +67,7 @@ #include "absl/types/span.h" #include "http2/adapter/data_source.h" #include "http2/adapter/http2_protocol.h" + #include "http2/adapter/http2_visitor_interface.h" + +// Required to build on Windows. +typedef ptrdiff_t ssize_t; @@ -74,24 +75,6 @@ #include "third_party/nghttp2/src/lib/includes/nghttp2/nghttp2.h" #include "spdy/core/spdy_header_block.h" ---- http2/adapter/oghttp2_session.cc -+++ http2/adapter/oghttp2_session.cc -@@ -131,6 +131,7 @@ absl::string_view TracePerspectiveAsStri - case Perspective::kServer: - return "OGHTTP2_SERVER"; - } -+ return "OGHTTP2_SERVER"; - } - - class RunOnExit { -@@ -186,6 +187,7 @@ Http2ErrorCode GetHttp2ErrorCode(SpdyFra - case SpdyFramerError::LAST_ERROR: - return Http2ErrorCode::INTERNAL_ERROR; - } -+ return Http2ErrorCode::INTERNAL_ERROR; - } - - } // namespace --- http2/adapter/http2_util.cc +++ http2/adapter/http2_util.cc @@ -1,5 +1,7 @@ @@ -102,30 +85,7 @@ namespace http2 { namespace adapter { namespace { -@@ -42,6 +44,7 @@ spdy::SpdyErrorCode TranslateErrorCode(H - case Http2ErrorCode::HTTP_1_1_REQUIRED: - return spdy::ERROR_CODE_HTTP_1_1_REQUIRED; - } -+ return spdy::ERROR_CODE_INTERNAL_ERROR; - } - - Http2ErrorCode TranslateErrorCode(spdy::SpdyErrorCode code) { -@@ -76,6 +77,7 @@ Http2ErrorCode TranslateErrorCode(spdy:: - case spdy::ERROR_CODE_HTTP_1_1_REQUIRED: - return Http2ErrorCode::HTTP_1_1_REQUIRED; - } -+ return Http2ErrorCode::INTERNAL_ERROR; - } - absl::string_view ConnectionErrorToString(ConnectionError error) { -@@ -95,6 +96,7 @@ absl::string_view ConnectionErrorToStrin - case ConnectionError::kInvalidPushPromise: - return "InvalidPushPromise"; - } -+ return "UnknownConnectionError"; - } - - } // namespace adapter --- http2/adapter/oghttp2_session.cc +++ http2/adapter/oghttp2_session.cc @@ -11,6 +11,8 @@ diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 0e8c2e5ec66bd..b2ed497e3a18a 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -838,12 +838,12 @@ REPOSITORY_LOCATIONS_SPEC = dict( project_name = "QUICHE", project_desc = "QUICHE (QUIC, HTTP/2, Etc) is Google‘s implementation of QUIC and related protocols", project_url = "https://github.com/google/quiche", - version = "0b75841d5b5844c53f4399a41d64de7250c204d8", - sha256 = "a00b0671180fc79952baf754148e65364bfca9d35b988710594752fb7f9bf6a1", + version = "4f552f349b8df000af24bc6cfa0b78fdc2467fef", + sha256 = "355c80803698d2a44363ed304d250059cc5d7712281481803717f8d779229bd8", urls = ["https://github.com/google/quiche/archive/{version}.tar.gz"], strip_prefix = "quiche-{version}", use_category = ["dataplane_core"], - release_date = "2021-11-02", + release_date = "2021-11-15", cpe = "N/A", ), com_googlesource_googleurl = dict( diff --git a/test/common/quic/envoy_quic_dispatcher_test.cc b/test/common/quic/envoy_quic_dispatcher_test.cc index 7e7e4fe0e49fa..3481ebc731fa8 100644 --- a/test/common/quic/envoy_quic_dispatcher_test.cc +++ b/test/common/quic/envoy_quic_dispatcher_test.cc @@ -160,7 +160,7 @@ class EnvoyQuicDispatcherTest : public testing::TestWithParamIsEncryptionEstablished()); EXPECT_EQ(1u, connection_handler_.numConnections()); auto envoy_connection = static_cast(session); - EXPECT_EQ("test.example.org", envoy_connection->requestedServerName()); + EXPECT_EQ("test.example.com", envoy_connection->requestedServerName()); EXPECT_EQ(peer_addr, envoyIpAddressToQuicSocketAddress( envoy_connection->connectionInfoProvider().remoteAddress()->ip())); ASSERT(envoy_connection->connectionInfoProvider().localAddress() != nullptr); @@ -190,7 +190,7 @@ class EnvoyQuicDispatcherTest : public testing::TestWithParamfilterChain(); })); Network::MockTransportSocketFactory transport_socket_factory; diff --git a/test/common/quic/envoy_quic_session_cache_test.cc b/test/common/quic/envoy_quic_session_cache_test.cc index 5490b0d491afa..c7601331597fb 100644 --- a/test/common/quic/envoy_quic_session_cache_test.cc +++ b/test/common/quic/envoy_quic_session_cache_test.cc @@ -31,9 +31,10 @@ std::vector createFakeStatelessResetToken() { std::unique_ptr makeFakeTransportParams() { auto params = std::make_unique(); params->perspective = quic::Perspective::IS_CLIENT; - params->version = FakeVersionLabel; - params->supported_versions.push_back(FakeVersionLabel); - params->supported_versions.push_back(FakeVersionLabel2); + params->legacy_version_information = quic::TransportParameters::LegacyVersionInformation(); + params->legacy_version_information->version = FakeVersionLabel; + params->legacy_version_information->supported_versions.push_back(FakeVersionLabel); + params->legacy_version_information->supported_versions.push_back(FakeVersionLabel2); params->max_idle_timeout_ms.set_value(FakeIdleTimeoutMilliseconds); params->stateless_reset_token = createFakeStatelessResetToken(); params->max_udp_payload_size.set_value(FakeMaxPacketSize);