diff options
author | adisbladis <adisbladis@gmail.com> | 2021-01-19 16:40:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-19 16:40:42 +0100 |
commit | 6dfd1a2772817da5d1fc0ca32343822e47d41e3b (patch) | |
tree | 99b279ef44e016db091d30767f395290056faf06 | |
parent | e286885b0f2a45f42ef1d99cb5632bbb11de9b7a (diff) | |
parent | 6e684ca91e89b224572736746470f44431cd956a (diff) |
Merge pull request #108741 from lukegb/envoy
envoy: init at 1.16.2
-rw-r--r-- | pkgs/build-support/build-bazel-package/default.nix | 4 | ||||
-rw-r--r-- | pkgs/servers/http/envoy/0001-quiche-update-QUICHE-tar-13949.patch | 2980 | ||||
-rw-r--r-- | pkgs/servers/http/envoy/0002-Add-upb-patch-to-make-it-compile-under-GCC10.patch | 91 | ||||
-rw-r--r-- | pkgs/servers/http/envoy/default.nix | 119 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
5 files changed, 3195 insertions, 1 deletions
diff --git a/pkgs/build-support/build-bazel-package/default.nix b/pkgs/build-support/build-bazel-package/default.nix index 10a331bcc9e7..3be72bd22c3f 100644 --- a/pkgs/build-support/build-bazel-package/default.nix +++ b/pkgs/build-support/build-bazel-package/default.nix @@ -172,7 +172,9 @@ in stdenv.mkDerivation (fBuildAttrs // { chmod -R +w $bazelOut find $bazelOut -type l | while read symlink; do - ln -sf $(readlink "$symlink" | sed "s,NIX_BUILD_TOP,$NIX_BUILD_TOP,") "$symlink" + if [[ $(readlink "$symlink") == *NIX_BUILD_TOP* ]]; then + ln -sf $(readlink "$symlink" | sed "s,NIX_BUILD_TOP,$NIX_BUILD_TOP,") "$symlink" + fi done '' + fBuildAttrs.preConfigure or ""; diff --git a/pkgs/servers/http/envoy/0001-quiche-update-QUICHE-tar-13949.patch b/pkgs/servers/http/envoy/0001-quiche-update-QUICHE-tar-13949.patch new file mode 100644 index 000000000000..4bf0a0d0e95d --- /dev/null +++ b/pkgs/servers/http/envoy/0001-quiche-update-QUICHE-tar-13949.patch @@ -0,0 +1,2980 @@ +From 97d7c456e03d4a11157fac17c7b8cbcee1d8a657 Mon Sep 17 00:00:00 2001 +From: danzh <danzh2010@users.noreply.github.com> +Date: Mon, 16 Nov 2020 14:27:13 -0500 +Subject: [PATCH] quiche: update QUICHE tar (#13949) + +Signed-off-by: Dan Zhang <danzh@google.com> +--- + bazel/envoy_internal.bzl | 2 + + bazel/external/quiche.BUILD | 85 +-- + bazel/repository_locations.bzl | 6 +- + source/extensions/quic_listeners/quiche/BUILD | 1 + + .../quiche/active_quic_listener.cc | 2 +- + .../quiche/envoy_quic_client_connection.cc | 2 +- + .../quiche/envoy_quic_client_stream.cc | 1 + + .../quiche/envoy_quic_connection.cc | 6 +- + .../quiche/envoy_quic_connection.h | 1 + + .../quiche/envoy_quic_dispatcher.cc | 6 +- + .../quiche/envoy_quic_dispatcher.h | 2 +- + .../quiche/envoy_quic_proof_source.cc | 2 +- + .../quiche/envoy_quic_proof_source.h | 2 +- + .../quiche/envoy_quic_proof_source_base.cc | 7 +- + .../quiche/envoy_quic_proof_source_base.h | 6 +- + .../quiche/envoy_quic_proof_verifier_base.cc | 4 +- + .../quiche/envoy_quic_server_connection.cc | 10 +- + .../quiche/envoy_quic_server_connection.h | 1 + + .../quic_listeners/quiche/platform/BUILD | 42 +- + .../quiche/platform/flags_impl.cc | 108 +++- + .../quiche/platform/flags_impl.h | 46 +- + .../quiche/platform/flags_list.h | 502 ------------------ + .../quiche/platform/http2_flags_impl.h | 4 +- + .../quiche/platform/quic_aligned_impl.h | 18 - + .../quiche/platform/quic_cert_utils_impl.cc | 38 +- + .../quiche/platform/quic_cert_utils_impl.h | 9 +- + .../quiche/platform/quic_fallthrough_impl.h | 11 - + .../quiche/platform/quic_file_utils_impl.cc | 4 +- + .../quiche/platform/quic_file_utils_impl.h | 6 +- + .../quiche/platform/quic_flags_impl.h | 6 +- + .../platform/quic_hostname_utils_impl.cc | 6 +- + .../platform/quic_hostname_utils_impl.h | 8 +- + .../quiche/platform/quic_macros_impl.h | 13 - + .../platform/quic_mem_slice_span_impl.cc | 3 +- + .../platform/quic_mem_slice_span_impl.h | 9 +- + ..._ptr_util_impl.h => quic_testvalue_impl.h} | 11 +- + .../platform/quic_udp_socket_platform_impl.h | 3 + + .../quiche/platform/quiche_arraysize_impl.h | 11 - + .../quiche/platform/quiche_optional_impl.h | 17 - + .../quiche/platform/quiche_text_utils_impl.h | 63 +-- + .../quiche/platform/quiche_time_utils_impl.cc | 4 +- + .../quiche/platform/quiche_time_utils_impl.h | 4 +- + .../platform/spdy_endianness_util_impl.h | 29 - + .../quiche/platform/spdy_flags_impl.h | 4 +- + .../quiche/platform/spdy_string_utils_impl.h | 2 +- + .../spdy_server_push_utils_for_envoy.cc | 10 +- + .../quiche/envoy_quic_client_session_test.cc | 2 +- + .../quiche/envoy_quic_client_stream_test.cc | 44 +- + .../quiche/envoy_quic_proof_source_test.cc | 6 +- + .../quiche/envoy_quic_proof_verifier_test.cc | 8 +- + .../quiche/envoy_quic_server_session_test.cc | 3 +- + .../quiche/envoy_quic_server_stream_test.cc | 53 +- + .../quic_listeners/quiche/platform/BUILD | 22 - + .../quiche/platform/http2_platform_test.cc | 22 +- + .../quiche/platform/quic_platform_test.cc | 61 +-- + .../quiche/platform/quic_test_output_impl.cc | 15 +- + .../quiche/platform/quic_test_output_impl.h | 12 +- + .../quiche/platform/quiche_platform_test.cc | 39 -- + .../quiche/platform/spdy_platform_test.cc | 20 +- + .../quic_listeners/quiche/test_proof_source.h | 2 +- + .../quic_listeners/quiche/test_utils.h | 4 +- + 61 files changed, 396 insertions(+), 1054 deletions(-) + delete mode 100644 source/extensions/quic_listeners/quiche/platform/flags_list.h + delete mode 100644 source/extensions/quic_listeners/quiche/platform/quic_aligned_impl.h + delete mode 100644 source/extensions/quic_listeners/quiche/platform/quic_fallthrough_impl.h + delete mode 100644 source/extensions/quic_listeners/quiche/platform/quic_macros_impl.h + rename source/extensions/quic_listeners/quiche/platform/{quiche_ptr_util_impl.h => quic_testvalue_impl.h} (52%) + delete mode 100644 source/extensions/quic_listeners/quiche/platform/quiche_arraysize_impl.h + delete mode 100644 source/extensions/quic_listeners/quiche/platform/quiche_optional_impl.h + delete mode 100644 source/extensions/quic_listeners/quiche/platform/spdy_endianness_util_impl.h + delete mode 100644 test/extensions/quic_listeners/quiche/platform/quiche_platform_test.cc + +diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl +index 5ad86609a..3f9ddfd23 100644 +--- a/bazel/envoy_internal.bzl ++++ b/bazel/envoy_internal.bzl +@@ -54,6 +54,8 @@ def envoy_copts(repository, test = False): + }) + select({ + repository + "//bazel:clang_build": ["-fno-limit-debug-info", "-Wgnu-conditional-omitted-operand", "-Wc++2a-extensions", "-Wrange-loop-analysis"], + repository + "//bazel:gcc_build": ["-Wno-maybe-uninitialized"], ++ # TODO: Replace with /Zc:preprocessor for cl.exe versions >= 16.5 ++ repository + "//bazel:windows_x86_64": ["-experimental:preprocessor", "-Wv:19.4"], + "//conditions:default": [], + }) + select({ + repository + "//bazel:no_debug_info": ["-g0"], +diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD +index 7541909aa..b6b208fc5 100644 +--- a/bazel/external/quiche.BUILD ++++ b/bazel/external/quiche.BUILD +@@ -57,16 +57,12 @@ quiche_common_copts = [ + "-Wno-unused-function", + # quic_inlined_frame.h uses offsetof() to optimize memory usage in frames. + "-Wno-invalid-offsetof", +- "-Wno-range-loop-analysis", + ] + + quiche_copts = select({ + # Ignore unguarded #pragma GCC statements in QUICHE sources + "@envoy//bazel:windows_x86_64": ["-wd4068"], + # Remove these after upstream fix. +- "@envoy//bazel:gcc_build": [ +- "-Wno-sign-compare", +- ] + quiche_common_copts, + "//conditions:default": quiche_common_copts, + }) + +@@ -737,7 +733,6 @@ envoy_cc_library( + hdrs = [ + "quiche/spdy/platform/api/spdy_bug_tracker.h", + "quiche/spdy/platform/api/spdy_containers.h", +- "quiche/spdy/platform/api/spdy_endianness_util.h", + "quiche/spdy/platform/api/spdy_estimate_memory_usage.h", + "quiche/spdy/platform/api/spdy_flags.h", + "quiche/spdy/platform/api/spdy_logging.h", +@@ -935,6 +930,7 @@ envoy_cc_library( + copts = quiche_copts, + repository = "@envoy", + deps = [ ++ ":http2_hpack_huffman_hpack_huffman_encoder_lib", + ":spdy_core_protocol_lib", + ":spdy_platform", + ], +@@ -1049,19 +1045,16 @@ envoy_cc_library( + envoy_cc_library( + name = "quic_platform_base", + hdrs = [ +- "quiche/quic/platform/api/quic_aligned.h", + "quiche/quic/platform/api/quic_bug_tracker.h", + "quiche/quic/platform/api/quic_client_stats.h", + "quiche/quic/platform/api/quic_containers.h", + "quiche/quic/platform/api/quic_error_code_wrappers.h", + "quiche/quic/platform/api/quic_estimate_memory_usage.h", + "quiche/quic/platform/api/quic_exported_stats.h", +- "quiche/quic/platform/api/quic_fallthrough.h", + "quiche/quic/platform/api/quic_flag_utils.h", + "quiche/quic/platform/api/quic_flags.h", + "quiche/quic/platform/api/quic_iovec.h", + "quiche/quic/platform/api/quic_logging.h", +- "quiche/quic/platform/api/quic_macros.h", + "quiche/quic/platform/api/quic_map_util.h", + "quiche/quic/platform/api/quic_mem_slice.h", + "quiche/quic/platform/api/quic_prefetch.h", +@@ -1072,6 +1065,7 @@ envoy_cc_library( + "quiche/quic/platform/api/quic_stream_buffer_allocator.h", + "quiche/quic/platform/api/quic_string_utils.h", + "quiche/quic/platform/api/quic_uint128.h", ++ "quiche/quic/platform/api/quic_testvalue.h", + # TODO: uncomment the following files as implementations are added. + # "quiche/quic/platform/api/quic_fuzzed_data_provider.h", + # "quiche/quic/platform/api/quic_test_loopback.h", +@@ -1147,7 +1141,6 @@ envoy_cc_test_library( + hdrs = ["quiche/quic/platform/api/quic_port_utils.h"], + repository = "@envoy", + tags = ["nofips"], +- deps = ["@envoy//test/extensions/quic_listeners/quiche/platform:quic_platform_port_utils_impl_lib"], + ) + + envoy_cc_library( +@@ -1216,15 +1209,14 @@ envoy_cc_test_library( + ) + + envoy_cc_library( +- name = "quiche_common_platform_endian", +- hdrs = ["quiche/common/platform/api/quiche_endian.h"], ++ name = "quiche_common_endian_lib", ++ hdrs = ["quiche/common/quiche_endian.h"], + repository = "@envoy", + tags = ["nofips"], + visibility = ["//visibility:public"], + deps = + [ + ":quiche_common_platform_export", +- "@envoy//source/extensions/quic_listeners/quiche/platform:quiche_common_platform_endian_impl_lib", + ], + ) + +@@ -1932,6 +1924,7 @@ envoy_cc_library( + visibility = ["//visibility:public"], + deps = [ + ":quic_core_clock_lib", ++ ":quic_core_crypto_certificate_view_lib", + ":quic_core_crypto_encryption_lib", + ":quic_core_crypto_hkdf_lib", + ":quic_core_crypto_proof_source_interface_lib", +@@ -2167,6 +2160,15 @@ envoy_cc_library( + ], + ) + ++envoy_cc_library( ++ name = "quic_core_flags_list_lib", ++ hdrs = ["quiche/quic/core/quic_flags_list.h"], ++ copts = quiche_copts, ++ repository = "@envoy", ++ tags = ["nofips"], ++ visibility = ["//visibility:public"], ++) ++ + envoy_cc_library( + name = "quic_core_framer_lib", + srcs = ["quiche/quic/core/quic_framer.cc"], +@@ -2339,6 +2341,7 @@ envoy_cc_library( + repository = "@envoy", + tags = ["nofips"], + deps = [ ++ ":http2_constants_lib", + ":quic_core_data_lib", + ":quic_core_error_codes_lib", + ":quic_core_http_http_frames_lib", +@@ -2723,6 +2726,27 @@ envoy_cc_library( + ], + ) + ++envoy_cc_library( ++ name = "quic_core_path_validator_lib", ++ srcs = ["quiche/quic/core/quic_path_validator.cc"], ++ hdrs = ["quiche/quic/core/quic_path_validator.h"], ++ copts = quiche_copts, ++ repository = "@envoy", ++ tags = ["nofips"], ++ deps = [ ++ ":quic_core_alarm_factory_interface_lib", ++ ":quic_core_alarm_interface_lib", ++ ":quic_core_arena_scoped_ptr_lib", ++ ":quic_core_clock_lib", ++ ":quic_core_constants_lib", ++ ":quic_core_crypto_random_lib", ++ ":quic_core_one_block_arena_lib", ++ ":quic_core_packet_writer_interface_lib", ++ ":quic_core_types_lib", ++ ":quic_platform", ++ ], ++) ++ + envoy_cc_library( + name = "quic_core_process_packet_interface_lib", + hdrs = ["quiche/quic/core/quic_process_packet_interface.h"], +@@ -2735,6 +2759,15 @@ envoy_cc_library( + ], + ) + ++envoy_cc_library( ++ name = "quic_core_protocol_flags_list_lib", ++ hdrs = ["quiche/quic/core/quic_protocol_flags_list.h"], ++ copts = quiche_copts, ++ repository = "@envoy", ++ tags = ["nofips"], ++ visibility = ["//visibility:public"], ++) ++ + envoy_cc_library( + name = "quic_core_qpack_blocking_manager_lib", + srcs = ["quiche/quic/core/qpack/qpack_blocking_manager.cc"], +@@ -2896,6 +2929,7 @@ envoy_cc_library( + deps = [ + ":http2_decoder_decode_buffer_lib", + ":http2_decoder_decode_status_lib", ++ ":quic_core_error_codes_lib", + ":quic_core_qpack_qpack_instruction_decoder_lib", + ":quic_core_qpack_qpack_instructions_lib", + ":quic_core_qpack_qpack_stream_receiver_lib", +@@ -3368,7 +3402,7 @@ envoy_cc_library( + ":quic_core_error_codes_lib", + ":quic_core_time_lib", + ":quic_platform_base", +- ":quiche_common_platform_endian", ++ ":quiche_common_endian_lib", + ], + ) + +@@ -3420,6 +3454,7 @@ envoy_cc_library( + repository = "@envoy", + tags = ["nofips"], + deps = [ ++ ":quic_core_circular_deque_lib", + ":quic_core_connection_stats_lib", + ":quic_core_packets_lib", + ":quic_core_session_notifier_interface_lib", +@@ -3459,6 +3494,7 @@ envoy_cc_library( + deps = [ + ":quic_core_versions_lib", + ":quic_platform_base", ++ ":quiche_common_endian_lib", + ], + ) + +@@ -3475,7 +3511,6 @@ envoy_cc_library( + ":quic_core_tag_lib", + ":quic_core_types_lib", + ":quic_platform_base", +- ":quiche_common_platform_endian", + ], + ) + +@@ -3746,6 +3781,7 @@ envoy_cc_test_library( + ":quic_core_packet_creator_lib", + ":quic_core_packet_writer_interface_lib", + ":quic_core_packets_lib", ++ ":quic_core_path_validator_lib", + ":quic_core_received_packet_manager_lib", + ":quic_core_sent_packet_manager_lib", + ":quic_core_server_id_lib", +@@ -3836,25 +3872,10 @@ envoy_cc_test_library( + deps = [":epoll_server_platform"], + ) + +-envoy_cc_library( +- name = "quiche_common_platform_optional", +- hdrs = ["quiche/common/platform/api/quiche_optional.h"], +- repository = "@envoy", +- tags = ["nofips"], +- visibility = ["//visibility:public"], +- deps = [ +- ":quiche_common_platform_export", +- "@envoy//source/extensions/quic_listeners/quiche/platform:quiche_common_platform_optional_impl_lib", +- ], +-) +- + envoy_cc_library( + name = "quiche_common_platform", + hdrs = [ +- "quiche/common/platform/api/quiche_arraysize.h", + "quiche/common/platform/api/quiche_logging.h", +- "quiche/common/platform/api/quiche_optional.h", +- "quiche/common/platform/api/quiche_ptr_util.h", + "quiche/common/platform/api/quiche_str_cat.h", + "quiche/common/platform/api/quiche_string_piece.h", + "quiche/common/platform/api/quiche_text_utils.h", +@@ -3866,7 +3887,6 @@ envoy_cc_library( + visibility = ["//visibility:public"], + deps = [ + ":quiche_common_platform_export", +- ":quiche_common_platform_optional", + "@envoy//source/extensions/quic_listeners/quiche/platform:quiche_common_platform_impl_lib", + ], + ) +@@ -3874,7 +3894,6 @@ envoy_cc_library( + envoy_cc_test_library( + name = "quiche_common_platform_test", + srcs = [ +- "quiche/common/platform/api/quiche_endian_test.cc", + "quiche/common/platform/api/quiche_str_cat_test.cc", + "quiche/common/platform/api/quiche_text_utils_test.cc", + "quiche/common/platform/api/quiche_time_utils_test.cc", +@@ -3884,7 +3903,6 @@ envoy_cc_test_library( + tags = ["nofips"], + deps = [ + ":quiche_common_platform", +- ":quiche_common_platform_endian", + "@envoy//test/extensions/quic_listeners/quiche/platform:quiche_common_platform_test_impl_lib", + ], + ) +@@ -3904,8 +3922,8 @@ envoy_cc_library( + tags = ["nofips"], + visibility = ["//visibility:public"], + deps = [ ++ ":quiche_common_endian_lib", + ":quiche_common_platform", +- ":quiche_common_platform_endian", + ], + ) + +@@ -3944,6 +3962,7 @@ envoy_cc_test( + deps = [ + ":http2_platform", + ":http2_test_tools_random", ++ ":quiche_common_test_tools_test_utils_lib", + ], + ) + +diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl +index 6eba5a821..19ddc76e8 100644 +--- a/bazel/repository_locations.bzl ++++ b/bazel/repository_locations.bzl +@@ -671,9 +671,9 @@ DEPENDENCY_REPOSITORIES_SPEC = dict( + project_name = "QUICHE", + project_desc = "QUICHE (QUIC, HTTP/2, Etc) is Google‘s implementation of QUIC and related protocols", + project_url = "https://quiche.googlesource.com/quiche", +- # Static snapshot of https://quiche.googlesource.com/quiche/+archive/f555d99a084cdd086a349548c70fb558ac5847cf.tar.gz +- version = "f555d99a084cdd086a349548c70fb558ac5847cf", +- sha256 = "1833f08e7b0f18b49d7498b029b7f3e6559a82113ec82a98a9e945553756e351", ++ # Static snapshot of https://quiche.googlesource.com/quiche/+archive/ecc28c0d7428f3323ea26eb1ddb98a5e06b23dea.tar.gz ++ version = "ecc28c0d7428f3323ea26eb1ddb98a5e06b23dea", ++ sha256 = "52680dea984dbe899c27176155578b97276e1f1516b7c3a63fb16ba593061859", + urls = ["https://storage.googleapis.com/quiche-envoy-integration/{version}.tar.gz"], + use_category = ["dataplane_ext"], + extensions = ["envoy.transport_sockets.quic"], +diff --git a/source/extensions/quic_listeners/quiche/BUILD b/source/extensions/quic_listeners/quiche/BUILD +index 29eb78d15..a90cfde6d 100644 +--- a/source/extensions/quic_listeners/quiche/BUILD ++++ b/source/extensions/quic_listeners/quiche/BUILD +@@ -212,6 +212,7 @@ envoy_cc_library( + "//source/common/buffer:buffer_lib", + "//source/common/common:assert_lib", + "//source/common/http:header_map_lib", ++ "//source/common/http:header_utility_lib", + "//source/extensions/quic_listeners/quiche/platform:quic_platform_mem_slice_storage_impl_lib", + "@com_googlesource_quiche//:quic_core_http_client_lib", + ], +diff --git a/source/extensions/quic_listeners/quiche/active_quic_listener.cc b/source/extensions/quic_listeners/quiche/active_quic_listener.cc +index f4808adc5..86912292a 100644 +--- a/source/extensions/quic_listeners/quiche/active_quic_listener.cc ++++ b/source/extensions/quic_listeners/quiche/active_quic_listener.cc +@@ -55,7 +55,7 @@ ActiveQuicListener::ActiveQuicListener( + quic::QuicRandom* const random = quic::QuicRandom::GetInstance(); + random->RandBytes(random_seed_, sizeof(random_seed_)); + crypto_config_ = std::make_unique<quic::QuicCryptoServerConfig>( +- quiche::QuicheStringPiece(reinterpret_cast<char*>(random_seed_), sizeof(random_seed_)), ++ absl::string_view(reinterpret_cast<char*>(random_seed_), sizeof(random_seed_)), + quic::QuicRandom::GetInstance(), + std::make_unique<EnvoyQuicProofSource>(listen_socket_, listener_config.filterChainManager(), + stats_), +diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_client_connection.cc b/source/extensions/quic_listeners/quiche/envoy_quic_client_connection.cc +index e79b08ad9..95d63729d 100644 +--- a/source/extensions/quic_listeners/quiche/envoy_quic_client_connection.cc ++++ b/source/extensions/quic_listeners/quiche/envoy_quic_client_connection.cc +@@ -43,7 +43,7 @@ EnvoyQuicClientConnection::EnvoyQuicClientConnection( + const quic::ParsedQuicVersionVector& supported_versions, Event::Dispatcher& dispatcher, + Network::ConnectionSocketPtr&& connection_socket) + : EnvoyQuicConnection( +- server_connection_id, ++ server_connection_id, quic::QuicSocketAddress(), + envoyIpAddressToQuicSocketAddress(connection_socket->remoteAddress()->ip()), helper, + alarm_factory, writer, owns_writer, quic::Perspective::IS_CLIENT, supported_versions, + std::move(connection_socket)), +diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_client_stream.cc b/source/extensions/quic_listeners/quiche/envoy_quic_client_stream.cc +index 866e35416..a759b26b1 100644 +--- a/source/extensions/quic_listeners/quiche/envoy_quic_client_stream.cc ++++ b/source/extensions/quic_listeners/quiche/envoy_quic_client_stream.cc +@@ -20,6 +20,7 @@ + + #include "common/buffer/buffer_impl.h" + #include "common/http/header_map_impl.h" ++#include "common/http/header_utility.h" + #include "common/common/assert.h" + + namespace Envoy { +diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_connection.cc b/source/extensions/quic_listeners/quiche/envoy_quic_connection.cc +index dcc311a6e..d813dfe4b 100644 +--- a/source/extensions/quic_listeners/quiche/envoy_quic_connection.cc ++++ b/source/extensions/quic_listeners/quiche/envoy_quic_connection.cc +@@ -6,6 +6,7 @@ namespace Envoy { + namespace Quic { + + EnvoyQuicConnection::EnvoyQuicConnection(const quic::QuicConnectionId& server_connection_id, ++ quic::QuicSocketAddress initial_self_address, + quic::QuicSocketAddress initial_peer_address, + quic::QuicConnectionHelperInterface& helper, + quic::QuicAlarmFactory& alarm_factory, +@@ -13,8 +14,9 @@ EnvoyQuicConnection::EnvoyQuicConnection(const quic::QuicConnectionId& server_co + quic::Perspective perspective, + const quic::ParsedQuicVersionVector& supported_versions, + Network::ConnectionSocketPtr&& connection_socket) +- : quic::QuicConnection(server_connection_id, initial_peer_address, &helper, &alarm_factory, +- writer, owns_writer, perspective, supported_versions), ++ : quic::QuicConnection(server_connection_id, initial_self_address, initial_peer_address, ++ &helper, &alarm_factory, writer, owns_writer, perspective, ++ supported_versions), + connection_socket_(std::move(connection_socket)) {} + + EnvoyQuicConnection::~EnvoyQuicConnection() { connection_socket_->close(); } +diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_connection.h b/source/extensions/quic_listeners/quiche/envoy_quic_connection.h +index f4c8589d7..f8543bc93 100644 +--- a/source/extensions/quic_listeners/quiche/envoy_quic_connection.h ++++ b/source/extensions/quic_listeners/quiche/envoy_quic_connection.h +@@ -26,6 +26,7 @@ class EnvoyQuicConnection : public quic::QuicConnection, + protected Logger::Loggable<Logger::Id::connection> { + public: + EnvoyQuicConnection(const quic::QuicConnectionId& server_connection_id, ++ quic::QuicSocketAddress initial_self_address, + quic::QuicSocketAddress initial_peer_address, + quic::QuicConnectionHelperInterface& helper, + quic::QuicAlarmFactory& alarm_factory, quic::QuicPacketWriter* writer, +diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_dispatcher.cc b/source/extensions/quic_listeners/quiche/envoy_quic_dispatcher.cc +index ba8f7f3a8..e6351f643 100644 +--- a/source/extensions/quic_listeners/quiche/envoy_quic_dispatcher.cc ++++ b/source/extensions/quic_listeners/quiche/envoy_quic_dispatcher.cc +@@ -48,11 +48,11 @@ void EnvoyQuicDispatcher::OnConnectionClosed(quic::QuicConnectionId connection_i + } + + std::unique_ptr<quic::QuicSession> EnvoyQuicDispatcher::CreateQuicSession( +- quic::QuicConnectionId server_connection_id, const quic::QuicSocketAddress& /*self_address*/, +- const quic::QuicSocketAddress& peer_address, quiche::QuicheStringPiece /*alpn*/, ++ quic::QuicConnectionId server_connection_id, const quic::QuicSocketAddress& self_address, ++ const quic::QuicSocketAddress& peer_address, absl::string_view /*alpn*/, + const quic::ParsedQuicVersion& version) { + auto quic_connection = std::make_unique<EnvoyQuicServerConnection>( +- server_connection_id, peer_address, *helper(), *alarm_factory(), writer(), ++ server_connection_id, self_address, peer_address, *helper(), *alarm_factory(), writer(), + /*owns_writer=*/false, quic::ParsedQuicVersionVector{version}, listen_socket_); + auto quic_session = std::make_unique<EnvoyQuicServerSession>( + config(), quic::ParsedQuicVersionVector{version}, std::move(quic_connection), this, +diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_dispatcher.h b/source/extensions/quic_listeners/quiche/envoy_quic_dispatcher.h +index 589ff5327..d59307f41 100644 +--- a/source/extensions/quic_listeners/quiche/envoy_quic_dispatcher.h ++++ b/source/extensions/quic_listeners/quiche/envoy_quic_dispatcher.h +@@ -62,7 +62,7 @@ protected: + std::unique_ptr<quic::QuicSession> + CreateQuicSession(quic::QuicConnectionId server_connection_id, + const quic::QuicSocketAddress& self_address, +- const quic::QuicSocketAddress& peer_address, quiche::QuicheStringPiece alpn, ++ const quic::QuicSocketAddress& peer_address, absl::string_view alpn, + const quic::ParsedQuicVersion& version) override; + + private: +diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_proof_source.cc b/source/extensions/quic_listeners/quiche/envoy_quic_proof_source.cc +index 1f65e4e7e..967765829 100644 +--- a/source/extensions/quic_listeners/quiche/envoy_quic_proof_source.cc ++++ b/source/extensions/quic_listeners/quiche/envoy_quic_proof_source.cc +@@ -36,7 +36,7 @@ EnvoyQuicProofSource::GetCertChain(const quic::QuicSocketAddress& server_address + + void EnvoyQuicProofSource::signPayload( + const quic::QuicSocketAddress& server_address, const quic::QuicSocketAddress& client_address, +- const std::string& hostname, uint16_t signature_algorithm, quiche::QuicheStringPiece in, ++ const std::string& hostname, uint16_t signature_algorithm, absl::string_view in, + std::unique_ptr<quic::ProofSource::SignatureCallback> callback) { + CertConfigWithFilterChain res = + getTlsCertConfigAndFilterChain(server_address, client_address, hostname); +diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_proof_source.h b/source/extensions/quic_listeners/quiche/envoy_quic_proof_source.h +index 6e1c74c92..e22bf3465 100644 +--- a/source/extensions/quic_listeners/quiche/envoy_quic_proof_source.h ++++ b/source/extensions/quic_listeners/quiche/envoy_quic_proof_source.h +@@ -28,7 +28,7 @@ protected: + // quic::ProofSource + void signPayload(const quic::QuicSocketAddress& server_address, + const quic::QuicSocketAddress& client_address, const std::string& hostname, +- uint16_t signature_algorithm, quiche::QuicheStringPiece in, ++ uint16_t signature_algorithm, absl::string_view in, + std::unique_ptr<quic::ProofSource::SignatureCallback> callback) override; + + private: +diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_proof_source_base.cc b/source/extensions/quic_listeners/quiche/envoy_quic_proof_source_base.cc +index 2c82c04d9..9ad3cb07f 100644 +--- a/source/extensions/quic_listeners/quiche/envoy_quic_proof_source_base.cc ++++ b/source/extensions/quic_listeners/quiche/envoy_quic_proof_source_base.cc +@@ -21,7 +21,7 @@ void EnvoyQuicProofSourceBase::GetProof(const quic::QuicSocketAddress& server_ad + const std::string& hostname, + const std::string& server_config, + quic::QuicTransportVersion /*transport_version*/, +- quiche::QuicheStringPiece chlo_hash, ++ absl::string_view chlo_hash, + std::unique_ptr<quic::ProofSource::Callback> callback) { + quic::QuicReferenceCountedPointer<quic::ProofSource::Chain> chain = + GetCertChain(server_address, client_address, hostname); +@@ -68,13 +68,12 @@ void EnvoyQuicProofSourceBase::GetProof(const quic::QuicSocketAddress& server_ad + auto signature_callback = std::make_unique<SignatureCallback>(std::move(callback), chain); + + signPayload(server_address, client_address, hostname, sign_alg, +- quiche::QuicheStringPiece(payload.get(), payload_size), +- std::move(signature_callback)); ++ absl::string_view(payload.get(), payload_size), std::move(signature_callback)); + } + + void EnvoyQuicProofSourceBase::ComputeTlsSignature( + const quic::QuicSocketAddress& server_address, const quic::QuicSocketAddress& client_address, +- const std::string& hostname, uint16_t signature_algorithm, quiche::QuicheStringPiece in, ++ const std::string& hostname, uint16_t signature_algorithm, absl::string_view in, + std::unique_ptr<quic::ProofSource::SignatureCallback> callback) { + signPayload(server_address, client_address, hostname, signature_algorithm, in, + std::move(callback)); +diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_proof_source_base.h b/source/extensions/quic_listeners/quiche/envoy_quic_proof_source_base.h +index b7d76981e..a9e7e8c3f 100644 +--- a/source/extensions/quic_listeners/quiche/envoy_quic_proof_source_base.h ++++ b/source/extensions/quic_listeners/quiche/envoy_quic_proof_source_base.h +@@ -57,7 +57,7 @@ public: + void GetProof(const quic::QuicSocketAddress& server_address, + const quic::QuicSocketAddress& client_address, const std::string& hostname, + const std::string& server_config, quic::QuicTransportVersion /*transport_version*/, +- quiche::QuicheStringPiece chlo_hash, ++ absl::string_view chlo_hash, + std::unique_ptr<quic::ProofSource::Callback> callback) override; + + TicketCrypter* GetTicketCrypter() override { return nullptr; } +@@ -65,14 +65,14 @@ public: + void ComputeTlsSignature(const quic::QuicSocketAddress& server_address, + const quic::QuicSocketAddress& client_address, + const std::string& hostname, uint16_t signature_algorithm, +- quiche::QuicheStringPiece in, ++ absl::string_view in, + std::unique_ptr<quic::ProofSource::SignatureCallback> callback) override; + + protected: + virtual void signPayload(const quic::QuicSocketAddress& server_address, + const quic::QuicSocketAddress& client_address, + const std::string& hostname, uint16_t signature_algorithm, +- quiche::QuicheStringPiece in, ++ absl::string_view in, + std::unique_ptr<quic::ProofSource::SignatureCallback> callback) PURE; + + private: +diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_proof_verifier_base.cc b/source/extensions/quic_listeners/quiche/envoy_quic_proof_verifier_base.cc +index 229b3ab36..e37590529 100644 +--- a/source/extensions/quic_listeners/quiche/envoy_quic_proof_verifier_base.cc ++++ b/source/extensions/quic_listeners/quiche/envoy_quic_proof_verifier_base.cc +@@ -58,8 +58,8 @@ bool EnvoyQuicProofVerifierBase::verifySignature(const std::string& server_confi + *error_details = "QuicPacketWriter error."; + return false; + } +- bool valid = cert_view->VerifySignature(quiche::QuicheStringPiece(payload.get(), payload_size), +- signature, sign_alg); ++ bool valid = cert_view->VerifySignature(absl::string_view(payload.get(), payload_size), signature, ++ sign_alg); + if (!valid) { + *error_details = "Signature is not valid."; + } +diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_server_connection.cc b/source/extensions/quic_listeners/quiche/envoy_quic_server_connection.cc +index b8fa94221..974c6c8eb 100644 +--- a/source/extensions/quic_listeners/quiche/envoy_quic_server_connection.cc ++++ b/source/extensions/quic_listeners/quiche/envoy_quic_server_connection.cc +@@ -11,11 +11,13 @@ namespace Quic { + + EnvoyQuicServerConnection::EnvoyQuicServerConnection( + const quic::QuicConnectionId& server_connection_id, +- quic::QuicSocketAddress initial_peer_address, quic::QuicConnectionHelperInterface& helper, +- quic::QuicAlarmFactory& alarm_factory, quic::QuicPacketWriter* writer, bool owns_writer, ++ quic::QuicSocketAddress initial_self_address, quic::QuicSocketAddress initial_peer_address, ++ quic::QuicConnectionHelperInterface& helper, quic::QuicAlarmFactory& alarm_factory, ++ quic::QuicPacketWriter* writer, bool owns_writer, + const quic::ParsedQuicVersionVector& supported_versions, Network::Socket& listen_socket) +- : EnvoyQuicConnection(server_connection_id, initial_peer_address, helper, alarm_factory, writer, +- owns_writer, quic::Perspective::IS_SERVER, supported_versions, ++ : EnvoyQuicConnection(server_connection_id, initial_self_address, initial_peer_address, helper, ++ alarm_factory, writer, owns_writer, quic::Perspective::IS_SERVER, ++ supported_versions, + std::make_unique<Network::ConnectionSocketImpl>( + // Wraps the real IoHandle instance so that if the connection socket + // gets closed, the real IoHandle won't be affected. +diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_server_connection.h b/source/extensions/quic_listeners/quiche/envoy_quic_server_connection.h +index 7b7fac05e..7625fad02 100644 +--- a/source/extensions/quic_listeners/quiche/envoy_quic_server_connection.h ++++ b/source/extensions/quic_listeners/quiche/envoy_quic_server_connection.h +@@ -10,6 +10,7 @@ namespace Quic { + class EnvoyQuicServerConnection : public EnvoyQuicConnection { + public: + EnvoyQuicServerConnection(const quic::QuicConnectionId& server_connection_id, ++ quic::QuicSocketAddress initial_self_address, + quic::QuicSocketAddress initial_peer_address, + quic::QuicConnectionHelperInterface& helper, + quic::QuicAlarmFactory& alarm_factory, quic::QuicPacketWriter* writer, +diff --git a/source/extensions/quic_listeners/quiche/platform/BUILD b/source/extensions/quic_listeners/quiche/platform/BUILD +index f53e07b58..839664d52 100644 +--- a/source/extensions/quic_listeners/quiche/platform/BUILD ++++ b/source/extensions/quic_listeners/quiche/platform/BUILD +@@ -36,15 +36,16 @@ envoy_extension_package() + envoy_cc_library( + name = "flags_impl_lib", + srcs = ["flags_impl.cc"], +- hdrs = [ +- "flags_impl.h", +- "flags_list.h", +- ], ++ hdrs = ["flags_impl.h"], + external_deps = [ + "abseil_base", + "abseil_synchronization", + ], + visibility = ["//visibility:public"], ++ deps = [ ++ "@com_googlesource_quiche//:quic_core_flags_list_lib", ++ "@com_googlesource_quiche//:quic_core_protocol_flags_list_lib", ++ ], + ) + + envoy_cc_library( +@@ -62,7 +63,6 @@ envoy_cc_library( + envoy_cc_library( + name = "http2_platform_impl_lib", + hdrs = [ +- "http2_arraysize_impl.h", + "http2_bug_tracker_impl.h", + "http2_containers_impl.h", + "http2_estimate_memory_usage_impl.h", +@@ -74,7 +74,6 @@ envoy_cc_library( + ], + external_deps = [ + "abseil_base", +- "abseil_optional", + "abseil_str_format", + ], + visibility = ["//visibility:public"], +@@ -114,16 +113,13 @@ envoy_cc_library( + "quic_mem_slice_impl.cc", + ], + hdrs = [ +- "quic_aligned_impl.h", + "quic_client_stats_impl.h", + "quic_containers_impl.h", + "quic_error_code_wrappers_impl.h", + "quic_estimate_memory_usage_impl.h", +- "quic_fallthrough_impl.h", + "quic_flag_utils_impl.h", + "quic_flags_impl.h", + "quic_iovec_impl.h", +- "quic_macros_impl.h", + "quic_map_util_impl.h", + "quic_mem_slice_impl.h", + "quic_prefetch_impl.h", +@@ -132,6 +128,7 @@ envoy_cc_library( + "quic_server_stats_impl.h", + "quic_stack_trace_impl.h", + "quic_stream_buffer_allocator_impl.h", ++ "quic_testvalue_impl.h", + "quic_uint128_impl.h", + ], + external_deps = [ +@@ -141,7 +138,6 @@ envoy_cc_library( + "abseil_memory", + "abseil_node_hash_map", + "abseil_node_hash_set", +- "abseil_optional", + ], + tags = ["nofips"], + visibility = ["//visibility:public"], +@@ -236,6 +232,7 @@ envoy_cc_library( + }), + repository = "@envoy", + tags = ["nofips"], ++ visibility = ["//visibility:public"], + ) + + envoy_cc_library( +@@ -250,23 +247,12 @@ envoy_cc_library( + ], + ) + |