diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index b641e9d59e848..6ca8429b3250c 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -53,23 +53,20 @@ genrule( # These options are only used to suppress errors in brought-in QUICHE tests. # Use #pragma GCC diagnostic ignored in integration code to suppress these errors. +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({ "@envoy//bazel:windows_x86_64": [], - "//conditions:default": [ - # Remove these after upstream fix. - "-Wno-unused-parameter", - "-Wno-unused-function", - "-Wno-return-type", - "-Wno-unknown-warning-option", - "-Wno-deprecated-copy", - "-Wno-ignored-qualifiers", - "-Wno-sign-compare", - "-Wno-inconsistent-missing-override", - # quic_inlined_frame.h uses offsetof() to optimize memory usage in frames. - "-Wno-invalid-offsetof", - # to suppress errors re: size_t vs. int comparisons + # Remove these after upstream fix. + "@envoy//bazel:gcc_build": [ "-Wno-sign-compare", - ], + ] + quiche_common_copts, + "//conditions:default": quiche_common_copts, }) test_suite( @@ -3534,6 +3531,23 @@ envoy_cc_test_library( ], ) +envoy_cc_library( + name = "quic_test_tools_flow_controller_peer_lib", + srcs = [ + "quiche/quic/test_tools/quic_flow_controller_peer.cc", + ], + hdrs = [ + "quiche/quic/test_tools/quic_flow_controller_peer.h", + ], + copts = quiche_copts, + repository = "@envoy", + tags = ["nofips"], + deps = [ + ":quic_core_packets_lib", + ":quic_core_session_lib", + ], +) + envoy_cc_test_library( name = "quic_test_tools_framer_peer_lib", srcs = ["quiche/quic/test_tools/quic_framer_peer.cc"], @@ -3667,6 +3681,7 @@ envoy_cc_test_library( ":quic_core_session_lib", ":quic_core_stream_send_buffer_lib", ":quic_platform_base", + ":quic_test_tools_flow_controller_peer_lib", ":quic_test_tools_stream_send_buffer_peer_lib", ], ) @@ -3831,7 +3846,6 @@ envoy_cc_library( hdrs = [ "quiche/common/platform/api/quiche_arraysize.h", "quiche/common/platform/api/quiche_logging.h", - "quiche/common/platform/api/quiche_map_util.h", "quiche/common/platform/api/quiche_optional.h", "quiche/common/platform/api/quiche_ptr_util.h", "quiche/common/platform/api/quiche_str_cat.h", diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index e1cddcc8513df..8224a9ab4b2e2 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -543,9 +543,9 @@ DEPENDENCY_REPOSITORIES_SPEC = dict( com_googlesource_quiche = dict( project_name = "QUICHE", project_url = "https://quiche.googlesource.com/quiche", - # Static snapshot of https://quiche.googlesource.com/quiche/+archive/96bd860bec207d4b722ab7f319fa47be129a85cd.tar.gz - version = "96bd860bec207d4b722ab7f319fa47be129a85cd", - sha256 = "d7129a2f41f2bd00a8a38b33f9b7b955d3e7de3dec20f69b70d7000d3a856360", + # Static snapshot of https://quiche.googlesource.com/quiche/+archive/f555d99a084cdd086a349548c70fb558ac5847cf.tar.gz + version = "f555d99a084cdd086a349548c70fb558ac5847cf", + sha256 = "1833f08e7b0f18b49d7498b029b7f3e6559a82113ec82a98a9e945553756e351", urls = ["https://storage.googleapis.com/quiche-envoy-integration/{version}.tar.gz"], use_category = ["dataplane"], cpe = "N/A", diff --git a/source/extensions/quic_listeners/quiche/BUILD b/source/extensions/quic_listeners/quiche/BUILD index 8338093b7998c..238792f4687d1 100644 --- a/source/extensions/quic_listeners/quiche/BUILD +++ b/source/extensions/quic_listeners/quiche/BUILD @@ -181,7 +181,7 @@ envoy_cc_library( ], tags = ["nofips"], deps = [ - ":envoy_quic_crypto_server_stream_lib", + ":envoy_quic_proof_source_lib", ":envoy_quic_stream_lib", ":envoy_quic_utils_lib", ":quic_filter_manager_connection_lib", @@ -445,14 +445,3 @@ envoy_cc_library( "@envoy_api//envoy/config/listener/v3:pkg_cc_proto", ], ) - -envoy_cc_library( - name = "envoy_quic_crypto_server_stream_lib", - srcs = ["envoy_quic_crypto_server_stream.cc"], - hdrs = ["envoy_quic_crypto_server_stream.h"], - tags = ["nofips"], - deps = [ - ":envoy_quic_proof_source_lib", - "@com_googlesource_quiche//:quic_core_http_spdy_session_lib", - ], -) diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_client_session.cc b/source/extensions/quic_listeners/quiche/envoy_quic_client_session.cc index 45f4ff749de6e..f049f4e83f346 100644 --- a/source/extensions/quic_listeners/quiche/envoy_quic_client_session.cc +++ b/source/extensions/quic_listeners/quiche/envoy_quic_client_session.cc @@ -99,7 +99,7 @@ EnvoyQuicClientSession::CreateIncomingStream(quic::PendingStream* /*pending*/) { bool EnvoyQuicClientSession::hasDataToWrite() { return HasDataToWrite(); } -void EnvoyQuicClientSession::OnOneRttKeysAvailable() { +void EnvoyQuicClientSession::OnTlsHandshakeComplete() { raiseConnectionEvent(Network::ConnectionEvent::Connected); } diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_client_session.h b/source/extensions/quic_listeners/quiche/envoy_quic_client_session.h index 4c14a11cf985c..cea3452607c06 100644 --- a/source/extensions/quic_listeners/quiche/envoy_quic_client_session.h +++ b/source/extensions/quic_listeners/quiche/envoy_quic_client_session.h @@ -56,7 +56,7 @@ class EnvoyQuicClientSession : public QuicFilterManagerConnectionImpl, void OnCanWrite() override; void OnGoAway(const quic::QuicGoAwayFrame& frame) override; void OnHttp3GoAway(uint64_t stream_id) override; - void OnOneRttKeysAvailable() override; + void OnTlsHandshakeComplete() override; // quic::QuicSpdyClientSessionBase void SetDefaultEncryptionLevel(quic::EncryptionLevel level) override; diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_crypto_server_stream.cc b/source/extensions/quic_listeners/quiche/envoy_quic_crypto_server_stream.cc deleted file mode 100644 index fb52d075c374d..0000000000000 --- a/source/extensions/quic_listeners/quiche/envoy_quic_crypto_server_stream.cc +++ /dev/null @@ -1,48 +0,0 @@ -#include "extensions/quic_listeners/quiche/envoy_quic_crypto_server_stream.h" - -namespace Envoy { -namespace Quic { - -void EnvoyQuicCryptoServerStream::EnvoyProcessClientHelloResultCallback::Run( - quic::QuicErrorCode error, const std::string& error_details, - std::unique_ptr message, - std::unique_ptr diversification_nonce, - std::unique_ptr proof_source_details) { - if (parent_ == nullptr) { - return; - } - - if (proof_source_details != nullptr) { - // Retain a copy of the proof source details after getting filter chain. - parent_->details_ = std::make_unique( - static_cast(*proof_source_details)); - } - parent_->done_cb_wrapper_ = nullptr; - parent_ = nullptr; - done_cb_->Run(error, error_details, std::move(message), std::move(diversification_nonce), - std::move(proof_source_details)); -} - -EnvoyQuicCryptoServerStream::~EnvoyQuicCryptoServerStream() { - if (done_cb_wrapper_ != nullptr) { - done_cb_wrapper_->cancel(); - } -} - -void EnvoyQuicCryptoServerStream::ProcessClientHello( - quic::QuicReferenceCountedPointer result, - std::unique_ptr proof_source_details, - std::unique_ptr done_cb) { - auto done_cb_wrapper = - std::make_unique(this, std::move(done_cb)); - ASSERT(done_cb_wrapper_ == nullptr); - done_cb_wrapper_ = done_cb_wrapper.get(); - // Old QUICHE code might call GetProof() earlier and pass in proof source instance here. But this - // is no longer the case, so proof_source_details should always be null. - ASSERT(proof_source_details == nullptr); - quic::QuicCryptoServerStream::ProcessClientHello(result, std::move(proof_source_details), - std::move(done_cb_wrapper)); -} - -} // namespace Quic -} // namespace Envoy diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_crypto_server_stream.h b/source/extensions/quic_listeners/quiche/envoy_quic_crypto_server_stream.h deleted file mode 100644 index faaa6254bdf89..0000000000000 --- a/source/extensions/quic_listeners/quiche/envoy_quic_crypto_server_stream.h +++ /dev/null @@ -1,89 +0,0 @@ -#pragma once - -#pragma GCC diagnostic push -// QUICHE allows unused parameters. -#pragma GCC diagnostic ignored "-Wunused-parameter" -// QUICHE uses offsetof(). -#pragma GCC diagnostic ignored "-Winvalid-offsetof" - -#include "quiche/quic/core/quic_crypto_server_stream.h" -#include "quiche/quic/core/tls_server_handshaker.h" - -#pragma GCC diagnostic pop - -#include "extensions/quic_listeners/quiche/envoy_quic_proof_source.h" - -#include - -namespace Envoy { -namespace Quic { - -class EnvoyCryptoServerStream : protected Logger::Loggable { -public: - virtual ~EnvoyCryptoServerStream() = default; - virtual const EnvoyQuicProofSourceDetails* proofSourceDetails() const = 0; -}; - -// A dedicated stream to do QUIC crypto handshake. -class EnvoyQuicCryptoServerStream : public quic::QuicCryptoServerStream, - public EnvoyCryptoServerStream { -public: - // A wrapper to retain proof source details which has filter chain. - class EnvoyProcessClientHelloResultCallback : public quic::ProcessClientHelloResultCallback { - public: - EnvoyProcessClientHelloResultCallback( - EnvoyQuicCryptoServerStream* parent, - std::unique_ptr done_cb) - : parent_(parent), done_cb_(std::move(done_cb)) {} - - // quic::ProcessClientHelloResultCallback - void Run(quic::QuicErrorCode error, const std::string& error_details, - std::unique_ptr message, - std::unique_ptr diversification_nonce, - std::unique_ptr proof_source_details) override; - - void cancel() { parent_ = nullptr; } - - private: - EnvoyQuicCryptoServerStream* parent_; - std::unique_ptr done_cb_; - }; - - EnvoyQuicCryptoServerStream(const quic::QuicCryptoServerConfig* crypto_config, - quic::QuicCompressedCertsCache* compressed_certs_cache, - quic::QuicSession* session, - quic::QuicCryptoServerStreamBase::Helper* helper) - : quic::QuicCryptoServerStream(crypto_config, compressed_certs_cache, session, helper) {} - - ~EnvoyQuicCryptoServerStream() override; - - // quic::QuicCryptoServerStream - // Override to retain ProofSource::Details. - void ProcessClientHello( - quic::QuicReferenceCountedPointer result, - std::unique_ptr proof_source_details, - std::unique_ptr done_cb) override; - // EnvoyCryptoServerStream - const EnvoyQuicProofSourceDetails* proofSourceDetails() const override { return details_.get(); } - -private: - EnvoyProcessClientHelloResultCallback* done_cb_wrapper_{nullptr}; - std::unique_ptr details_; -}; - -// A dedicated stream to do TLS1.3 handshake. -class EnvoyQuicTlsServerHandshaker : public quic::TlsServerHandshaker, - public EnvoyCryptoServerStream { -public: - EnvoyQuicTlsServerHandshaker(quic::QuicSession* session, - const quic::QuicCryptoServerConfig& crypto_config) - : quic::TlsServerHandshaker(session, crypto_config) {} - - // EnvoyCryptoServerStream - const EnvoyQuicProofSourceDetails* proofSourceDetails() const override { - return dynamic_cast(proof_source_details()); - } -}; - -} // namespace Quic -} // namespace Envoy diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_server_session.cc b/source/extensions/quic_listeners/quiche/envoy_quic_server_session.cc index bc708dea4866f..d827855e60f00 100644 --- a/source/extensions/quic_listeners/quiche/envoy_quic_server_session.cc +++ b/source/extensions/quic_listeners/quiche/envoy_quic_server_session.cc @@ -4,7 +4,7 @@ #include "common/common/assert.h" -#include "extensions/quic_listeners/quiche/envoy_quic_crypto_server_stream.h" +#include "extensions/quic_listeners/quiche/envoy_quic_proof_source.h" #include "extensions/quic_listeners/quiche/envoy_quic_server_stream.h" namespace Envoy { @@ -34,17 +34,7 @@ std::unique_ptr EnvoyQuicServerSession::CreateQuicCryptoServerStream( const quic::QuicCryptoServerConfig* crypto_config, quic::QuicCompressedCertsCache* compressed_certs_cache) { - switch (connection()->version().handshake_protocol) { - case quic::PROTOCOL_QUIC_CRYPTO: - return std::make_unique(crypto_config, compressed_certs_cache, - this, stream_helper()); - case quic::PROTOCOL_TLS1_3: - return std::make_unique(this, *crypto_config); - case quic::PROTOCOL_UNSUPPORTED: - PANIC(fmt::format("Unknown handshake protocol: {}", - static_cast(connection()->version().handshake_protocol))); - } - return nullptr; + return CreateCryptoServerStream(crypto_config, compressed_certs_cache, this, stream_helper()); } quic::QuicSpdyStream* EnvoyQuicServerSession::CreateIncomingStream(quic::QuicStreamId id) { @@ -117,15 +107,15 @@ void EnvoyQuicServerSession::SetDefaultEncryptionLevel(quic::EncryptionLevel lev bool EnvoyQuicServerSession::hasDataToWrite() { return HasDataToWrite(); } -void EnvoyQuicServerSession::OnOneRttKeysAvailable() { - quic::QuicServerSessionBase::OnOneRttKeysAvailable(); +void EnvoyQuicServerSession::OnTlsHandshakeComplete() { + quic::QuicServerSessionBase::OnTlsHandshakeComplete(); maybeCreateNetworkFilters(); raiseConnectionEvent(Network::ConnectionEvent::Connected); } void EnvoyQuicServerSession::maybeCreateNetworkFilters() { - const EnvoyQuicProofSourceDetails* proof_source_details = - dynamic_cast(GetCryptoStream())->proofSourceDetails(); + auto proof_source_details = + dynamic_cast(GetCryptoStream()->ProofSourceDetails()); ASSERT(proof_source_details != nullptr, "ProofSource didn't provide ProofSource::Details. No filter chain will be installed."); diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_server_session.h b/source/extensions/quic_listeners/quiche/envoy_quic_server_session.h index a50e6fbe8f44c..ec117c3aa91e2 100644 --- a/source/extensions/quic_listeners/quiche/envoy_quic_server_session.h +++ b/source/extensions/quic_listeners/quiche/envoy_quic_server_session.h @@ -8,6 +8,8 @@ #pragma GCC diagnostic ignored "-Wtype-limits" #include "quiche/quic/core/http/quic_server_session_base.h" +#include "quiche/quic/core/quic_crypto_server_stream.h" +#include "quiche/quic/core/tls_server_handshaker.h" #pragma GCC diagnostic pop @@ -15,7 +17,6 @@ #include "extensions/quic_listeners/quiche/quic_filter_manager_connection_impl.h" #include "extensions/quic_listeners/quiche/envoy_quic_server_stream.h" -#include "extensions/quic_listeners/quiche/envoy_quic_crypto_server_stream.h" namespace Envoy { namespace Quic { @@ -52,7 +53,7 @@ class EnvoyQuicServerSession : public quic::QuicServerSessionBase, quic::ConnectionCloseSource source) override; void Initialize() override; void OnCanWrite() override; - void OnOneRttKeysAvailable() override; + void OnTlsHandshakeComplete() override; // quic::QuicSpdySession void SetDefaultEncryptionLevel(quic::EncryptionLevel level) override; diff --git a/source/extensions/quic_listeners/quiche/platform/flags_list.h b/source/extensions/quic_listeners/quiche/platform/flags_list.h index 587e80054c0a3..7e9e20a7c192c 100644 --- a/source/extensions/quic_listeners/quiche/platform/flags_list.h +++ b/source/extensions/quic_listeners/quiche/platform/flags_list.h @@ -17,16 +17,23 @@ QUICHE_FLAG( bool, http2_reloadable_flag_http2_backend_alpn_failure_error_code, false, "If true, the GFE will return a new ResponseCodeDetails error when ALPN to the backend fails.") -QUICHE_FLAG(bool, http2_reloadable_flag_http2_ip_based_cwnd_exp, false, +QUICHE_FLAG(bool, http2_reloadable_flag_http2_ip_based_cwnd_exp, true, "If true, enable IP address based CWND bootstrapping experiment with different " "bandwidth models and priorities in HTTP2.") +QUICHE_FLAG( + bool, http2_reloadable_flag_http2_load_based_goaway_warning, false, + "If true, load-based connection closures will send a warning GOAWAY before the actual GOAWAY.") + QUICHE_FLAG(bool, http2_reloadable_flag_http2_security_requirement_for_client3, false, "If true, check whether client meets security requirements during SSL handshake. If " "flag is true and client does not meet security requirements, do not negotiate HTTP/2 " "with client or terminate the session with SPDY_INADEQUATE_SECURITY if HTTP/2 is " "already negotiated. The spec contains both cipher and TLS version requirements.") +QUICHE_FLAG(bool, http2_reloadable_flag_http2_websocket_detection, false, + "If true, uses a HTTP/2-specific method of detecting websocket upgrade requests.") + QUICHE_FLAG(bool, http2_reloadable_flag_permissive_http2_switch, false, "If true, the GFE allows both HTTP/1.0 and HTTP/1.1 versions in HTTP/2 upgrade " "requests/responses.") @@ -39,14 +46,23 @@ QUICHE_FLAG(bool, quic_reloadable_flag_gclb_quic_allow_alia, true, "If gfe2_reloadable_flag_gclb_use_alia is also true, use Alia for GCLB QUIC " "handshakes. To be used as a big red button if there's a problem with Alia/QUIC.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_abort_qpack_on_stream_close, false, + "If true, abort async QPACK header decompression in QuicSpdyStream::OnClose().") + QUICHE_FLAG(bool, quic_reloadable_flag_quic_ack_delay_alarm_granularity, false, "When true, ensure the ACK delay is never less than the alarm granularity when ACK " "decimation is enabled.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_add_silent_idle_timeout, false, +QUICHE_FLAG(bool, quic_reloadable_flag_quic_add_missing_connected_checks, false, + "If true, add missing connected checks.") + +QUICHE_FLAG(bool, quic_reloadable_flag_quic_add_silent_idle_timeout, true, "If true, when server is silently closing connections due to idle timeout, serialize " "the connection close packets which will be added to time wait list.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_add_stream_info_to_idle_close_detail, false, + "If true, include stream information in idle timeout connection close detail.") + QUICHE_FLAG(bool, quic_reloadable_flag_quic_allow_backend_set_stream_ttl, false, "If true, check backend response header for X-Response-Ttl. If it is provided, the " "stream TTL is set. A QUIC stream will be immediately canceled when tries to write " @@ -65,38 +81,33 @@ QUICHE_FLAG(bool, quic_reloadable_flag_quic_bbr2_fewer_startup_round_trips, fals "When true, the 1RTT and 2RTT connection options decrease the number of round trips in " "BBRv2 STARTUP without a 25% bandwidth increase to 1 or 2 round trips respectively.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_bbr2_ignore_inflight_lo, false, - "When true, QUIC's BBRv2 ignores inflight_lo in PROBE_BW.") - -QUICHE_FLAG(bool, quic_reloadable_flag_quic_bbr2_improve_adjust_network_parameters, false, - "If true, improve Bbr2Sender::AdjustNetworkParameters by 1) do not inject a bandwidth " - "sample to the bandwidth filter, and 2) re-calculate pacing rate after cwnd updated..") - QUICHE_FLAG( bool, quic_reloadable_flag_quic_bbr2_limit_inflight_hi, false, "When true, the B2HI connection option limits reduction of inflight_hi to (1-Beta)*CWND.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_bbr_flexible_app_limited, false, - "When true and the BBR9 connection option is present, BBR only considers bandwidth " - "samples app-limited if they're not filling the pipe.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_bbr2_use_post_inflight_to_detect_queuing, false, + "If true, QUIC BBRv2 will use inflight byte after congestion event to detect queuing " + "during PROBE_UP.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_bbr_no_bytes_acked_in_startup_recovery, false, "When in STARTUP and recovery, do not add bytes_acked to QUIC BBR's CWND in " "CalculateCongestionWindow()") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_bootstrap_cwnd_by_gfe_bandwidth, false, - "If true, bootstrap initial QUIC cwnd by GFE measured bandwidth models.") - QUICHE_FLAG(bool, quic_reloadable_flag_quic_bootstrap_cwnd_by_spdy_priority, true, "If true, bootstrap initial QUIC cwnd by SPDY priorities.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_check_encryption_level_in_fast_path, false, - "If true, when data is sending in fast path mode in the creator, making sure stream " - "data is sent in the right encryption level.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_cap_large_client_initial_rtt, true, + "If true, cap client suggested initial RTT to 1s if it is longer than 1s.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_coalesced_packet_of_higher_space2, false, - "If true, try to coalesce packet of higher space with retransmissions to mitigate RTT " - "inflations.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_clean_up_spdy_session_destructor, false, + "If true, QuicSpdySession's destructor won't need to do cleanup.") + +QUICHE_FLAG(bool, quic_reloadable_flag_quic_close_connection_in_on_can_write_with_blocked_writer, + false, + "If true, close connection if writer is still blocked while OnCanWrite is called.") + +QUICHE_FLAG(bool, quic_reloadable_flag_quic_close_connection_on_serialization_failure, false, + "If true, close connection on packet serialization failures.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_conservative_bursts, false, "If true, set burst token to 2 in cwnd bootstrapping experiment.") @@ -104,6 +115,10 @@ QUICHE_FLAG(bool, quic_reloadable_flag_quic_conservative_bursts, false, QUICHE_FLAG(bool, quic_reloadable_flag_quic_conservative_cwnd_and_pacing_gains, false, "If true, uses conservative cwnd gain and pacing gain when cwnd gets bootstrapped.") +QUICHE_FLAG( + bool, quic_reloadable_flag_quic_copy_bbr_cwnd_to_bbr2, false, + "If true, when switching from BBR to BBRv2, BBRv2 will use BBR's cwnd as its initial cwnd.") + QUICHE_FLAG(bool, quic_reloadable_flag_quic_default_enable_5rto_blackhole_detection2, true, "If true, default-enable 5RTO blachole detection.") @@ -117,15 +132,9 @@ QUICHE_FLAG(bool, quic_reloadable_flag_quic_default_to_bbr_v2, false, "If true, use BBRv2 as the default congestion controller. Takes precedence over " "--quic_default_to_bbr.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_determine_serialized_packet_fate_early, false, - "If true, determine a serialized packet's fate before the packet gets serialized.") - QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_server_blackhole_detection, false, "If true, disable blackhole detection on server side.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_draft_25, true, - "If true, disable QUIC version h3-25.") - QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_draft_27, false, "If true, disable QUIC version h3-27.") @@ -144,76 +153,64 @@ QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_q050, false, QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_t050, false, "If true, disable QUIC version h3-T050.") -QUICHE_FLAG( - bool, quic_reloadable_flag_quic_dispatcher_legacy_version_encapsulation, false, - "When true, QuicDispatcher supports decapsulation of Legacy Version Encapsulation packets.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_t051, false, + "If true, disable QUIC version h3-T051.") + +QUICHE_FLAG(bool, quic_reloadable_flag_quic_discard_initial_packet_with_key_dropped, false, + "If true, discard INITIAL packet if the key has been dropped.") QUICHE_FLAG( bool, quic_reloadable_flag_quic_do_not_accept_stop_waiting, false, "In v44 and above, where STOP_WAITING is never sent, close the connection if it's received.") -QUICHE_FLAG( - bool, quic_reloadable_flag_quic_do_not_close_stream_again_on_connection_close, false, - "If true, do not try to close stream again if stream fails to be closed upon connection close.") - -QUICHE_FLAG(bool, quic_reloadable_flag_quic_do_not_use_stream_map, false, - "If true, QUIC subclasses will no longer directly access stream_map for its content.") - QUICHE_FLAG(bool, quic_reloadable_flag_quic_donot_reset_ideal_next_packet_send_time, false, "If true, stop resetting ideal_next_packet_send_time_ in pacing sender.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_dont_pad_chlo, true, - "When true, do not pad the QUIC_CRYPTO CHLO message itself. Note that the packet " - "containing the CHLO will still be padded.") - -QUICHE_FLAG(bool, quic_reloadable_flag_quic_dont_send_max_ack_delay_if_default, true, - "When true, QUIC_CRYPTO versions of QUIC will not send the max ACK delay unless it is " - "configured to a non-default value.") - QUICHE_FLAG(bool, quic_reloadable_flag_quic_enable_loss_detection_experiment_at_gfe, false, "If ture, enable GFE-picked loss detection experiment.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_enable_loss_detection_tuner, false, "If true, allow QUIC loss detection tuning to be enabled by connection option ELDT.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_enable_overshooting_detection, false, - "If true, enable overshooting detection when the DTOS connection option is supplied.") - -QUICHE_FLAG(bool, quic_reloadable_flag_quic_enable_version_t051, false, - "If true, enable QUIC version h3-T051.") +QUICHE_FLAG( + bool, quic_reloadable_flag_quic_enable_mtu_discovery_at_server, false, + "If true, QUIC will default enable MTU discovery at server, with a target of 1450 bytes.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_enabled, false, "") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_extra_padding_bytes, false, - "If true, consider frame expansion when calculating extra padding bytes to meet " - "minimum plaintext packet size required for header protection.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_arm_pto_for_application_data, false, + "If true, do not arm PTO for application data until handshake confirmed.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_neuter_handshake_data, false, - "If true, fix a case where data is marked lost in HANDSHAKE level but HANDSHAKE key " - "gets decrypted later.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_bytes_left_for_batch_write, false, + "If true, convert bytes_left_for_batch_write_ to unsigned int.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_packet_number_length, false, - "If true, take the largest acked packet into account when computing the sent packet " - "number length.") +QUICHE_FLAG( + bool, quic_reloadable_flag_quic_fix_http3_goaway_stream_id, false, + "If true, send the lowest stream ID that can be retried by the client in a GOAWAY frame. If " + "false, send the highest received stream ID, which actually should not be retried.") + +QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_out_of_order_sending, false, + "If true, fix a potential out of order sending caused by handshake gets confirmed " + "while the coalescer is not empty.") + +QUICHE_FLAG( + bool, quic_reloadable_flag_quic_fix_pto_pending_timer_count, false, + "If true, make sure there is pending timer credit when trying to PTO retransmit any packets.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_print_draft_version, false, - "When true, ParsedQuicVersionToString will print IETF drafts with format draft29 " - "instead of ff00001d.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_undecryptable_packets2, false, + "If true, remove processed undecryptable packets.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_get_stream_information_from_stream_map, false, +QUICHE_FLAG(bool, quic_reloadable_flag_quic_get_stream_information_from_stream_map, true, "If true, gQUIC will only consult stream_map in QuicSession::GetNumActiveStreams().") -QUICHE_FLAG( - bool, quic_reloadable_flag_quic_http3_goaway_new_behavior, false, - "If true, server accepts GOAWAY (draft-28 behavior), client receiving GOAWAY with stream ID " - "that is not client-initiated bidirectional stream ID closes connection with H3_ID_ERROR " - "(draft-28 behavior). Also, receiving a GOAWAY with ID larger than previously received closes " - "connection with H3_ID_ERROR. If false, server receiving GOAWAY closes connection with " - "H3_FRAME_UNEXPECTED (draft-27 behavior), client receiving GOAWAY with stream ID that is not " - "client-initiated bidirectional stream ID closes connection with PROTOCOL_VIOLATION (draft-04 " - "behavior), larger ID than previously received does not trigger connection close.") - -QUICHE_FLAG(bool, quic_reloadable_flag_quic_ip_based_cwnd_exp, false, +QUICHE_FLAG(bool, quic_reloadable_flag_quic_give_sent_packet_to_debug_visitor_after_sent, false, + "If true, QUIC connection will pass sent packet information to the debug visitor after " + "a packet is recorded as sent in sent packet manager.") + +QUICHE_FLAG(bool, quic_reloadable_flag_quic_http3_new_default_urgency_value, false, + "If true, QuicStream::kDefaultUrgency is 3, otherwise 1.") + +QUICHE_FLAG(bool, quic_reloadable_flag_quic_ip_based_cwnd_exp, true, "If true, enable IP address based CWND bootstrapping experiment with different " "bandwidth models and priorities. ") @@ -221,13 +218,27 @@ QUICHE_FLAG(bool, quic_reloadable_flag_quic_listener_never_fake_epollout, false, "If true, QuicListener::OnSocketIsWritable will always return false, which means there " "will never be a fake EPOLLOUT event in the next epoll iteration.") +QUICHE_FLAG(bool, + quic_reloadable_flag_quic_neuter_initial_packet_in_coalescer_with_initial_key_discarded, + false, "If true, neuter initial packet in the coalescer when discarding initial keys.") + QUICHE_FLAG(bool, quic_reloadable_flag_quic_no_dup_experiment_id_2, false, "If true, transport connection stats doesn't report duplicated experiments for same " "connection.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_no_silent_close_for_idle_timeout, true, + "If true, always send connection close for idle timeout if NSLC is received.") + +QUICHE_FLAG(bool, quic_reloadable_flag_quic_only_set_uaid_in_tcs_visitor, false, + "If true, QuicTransportConnectionStatsVisitor::PopulateTransportConnectionStats will " + "be the only place where TCS's uaid field is set.") + QUICHE_FLAG(bool, quic_reloadable_flag_quic_only_truncate_long_cids, true, "In IETF QUIC, only truncate long CIDs from the client's Initial, don't modify them.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_preferred_altsvc_version, false, + "When true, we will send a preferred QUIC version at the start of our Alt-Svc list.") + QUICHE_FLAG(bool, quic_reloadable_flag_quic_proxy_write_packed_strings, false, "If true, QuicProxyDispatcher will write packed_client_address and packed_server_vip " "in TcpProxyHeaderProto.") @@ -241,14 +252,7 @@ QUICHE_FLAG(bool, quic_reloadable_flag_quic_record_received_min_ack_delay, false QUICHE_FLAG(bool, quic_reloadable_flag_quic_reject_all_traffic, false, "") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_remove_streams_waiting_for_acks, false, - "If true, QuicSession will no longer need streams_waiting_for_acks_.") - -QUICHE_FLAG(bool, quic_reloadable_flag_quic_remove_unused_ack_options, false, - "Remove ACK_DECIMATION_WITH_REORDERING mode and fast_ack_after_quiescence option in " - "QUIC received packet manager.") - -QUICHE_FLAG(bool, quic_reloadable_flag_quic_remove_zombie_streams, false, +QUICHE_FLAG(bool, quic_reloadable_flag_quic_remove_zombie_streams, true, "If true, QuicSession doesn't keep a separate zombie_streams. Instead, all streams are " "stored in stream_map_.") @@ -256,35 +260,32 @@ QUICHE_FLAG(bool, quic_reloadable_flag_quic_require_handshake_confirmation, fals "If true, require handshake confirmation for QUIC connections, functionally disabling " "0-rtt handshakes.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_retransmit_handshake_data_early, false, - "If true, retransmit unacked handshake data before PTO expiry.") - QUICHE_FLAG( - bool, quic_reloadable_flag_quic_revert_mtu_after_two_ptos, false, - "If true, QUIC connection will revert to a previously validated MTU(if exists) after two PTOs.") - -QUICHE_FLAG(bool, quic_reloadable_flag_quic_save_user_agent_in_quic_session, true, - "If true, save user agent into in QuicSession.") - -QUICHE_FLAG(bool, quic_reloadable_flag_quic_send_early_data_header_to_backend, false, - "If true, for 0RTT IETF QUIC requests, GFE will append a Early-Data header and send it " - "to backend.") + bool, quic_reloadable_flag_quic_send_key_update_not_yet_supported, false, + "When true, QUIC+TLS versions will send the key_update_not_yet_supported transport parameter.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_send_path_response, false, - "If true, send PATH_RESPONSE upon receiving PATH_CHALLENGE regardless of perspective.") + "If true, send PATH_RESPONSE upon receiving PATH_CHALLENGE regardless of perspective. " + "--gfe2_reloadable_flag_quic_start_peer_migration_earlier has to be true before turn " + "on this flag.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_send_timestamps, false, "When the STMP connection option is sent by the client, timestamps in the QUIC ACK " "frame are sent and processed.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_server_push, true, +QUICHE_FLAG(bool, quic_reloadable_flag_quic_server_push, false, "If true, enable server push feature on QUIC.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_simplify_received_packet_manager_ack, false, - "Simplify the ACK code in quic_received_packet_manager.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_set_resumed_ssl_session_early, false, + "If true, set resumed_ssl_session if this is a 0-RTT connection.") + +QUICHE_FLAG(bool, quic_reloadable_flag_quic_start_peer_migration_earlier, false, + "If true, while reading an IETF quic packet, start peer migration immediately when " + "detecting the existence of any non-probing frame instead of at the end of the packet.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_support_handshake_done_in_t050, true, - "If true, support HANDSHAKE_DONE frame in T050.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_stop_sending_uses_ietf_error_code, false, + "If true, use IETF QUIC application error codes in STOP_SENDING frames. If false, use " + "QuicRstStreamErrorCodes.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_testonly_default_false, false, "A testonly reloadable flag that will always default to false.") @@ -296,12 +297,6 @@ QUICHE_FLAG(bool, quic_reloadable_flag_quic_unified_iw_options, false, "When true, set the initial congestion control window from connection options in " "QuicSentPacketManager rather than TcpCubicSenderBytes.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_update_packet_size, false, - "If true, update packet size when the first frame gets queued.") - -QUICHE_FLAG(bool, quic_reloadable_flag_quic_use_half_rtt_as_first_pto, false, - "If true, when TLPR copt is used, enable half RTT as first PTO timeout.") - QUICHE_FLAG(bool, quic_reloadable_flag_quic_use_header_stage_idle_list2, false, "If true, use header stage idle list for QUIC connections in GFE.") @@ -327,16 +322,16 @@ QUICHE_FLAG( bool, quic_restart_flag_quic_allow_loas_multipacket_chlo, false, "If true, inspects QUIC CHLOs for kLOAS and early creates sessions to allow multi-packet CHLOs") -QUICHE_FLAG(bool, quic_restart_flag_quic_enable_tls_resumption_v4, false, +QUICHE_FLAG( + bool, quic_restart_flag_quic_disable_gws_cwnd_experiment, false, + "If true, X-Google-Gws-Initial-Cwnd-Mode related header sent by GWS becomes no-op for QUIC.") + +QUICHE_FLAG(bool, quic_restart_flag_quic_enable_tls_resumption_v4, true, "If true, enables support for TLS resumption in QUIC.") -QUICHE_FLAG(bool, quic_restart_flag_quic_enable_zero_rtt_for_tls_v2, false, +QUICHE_FLAG(bool, quic_restart_flag_quic_enable_zero_rtt_for_tls_v2, true, "If true, support for IETF QUIC 0-rtt is enabled.") -QUICHE_FLAG(bool, quic_restart_flag_quic_google_transport_param_omit_old, true, - "When true, QUIC+TLS will not send nor parse the old-format Google-specific transport " - "parameters.") - QUICHE_FLAG(bool, quic_restart_flag_quic_offload_pacing_to_usps2, false, "If true, QUIC offload pacing when using USPS as egress method.") @@ -367,6 +362,9 @@ QUICHE_FLAG(bool, quic_restart_flag_quic_use_pigeon_socket_to_backend, false, QUICHE_FLAG(bool, spdy_reloadable_flag_quic_bootstrap_cwnd_by_spdy_priority, true, "If true, bootstrap initial QUIC cwnd by SPDY priorities.") +QUICHE_FLAG(bool, spdy_reloadable_flag_quic_clean_up_spdy_session_destructor, false, + "If true, QuicSpdySession's destructor won't need to do cleanup.") + QUICHE_FLAG( bool, spdy_reloadable_flag_spdy_discard_response_body_if_disallowed, false, "If true, SPDY will discard all response body bytes when response code indicates no response " diff --git a/source/extensions/quic_listeners/quiche/udp_gso_batch_writer.cc b/source/extensions/quic_listeners/quiche/udp_gso_batch_writer.cc index d4cbc87fc5066..cd1b3a9384479 100644 --- a/source/extensions/quic_listeners/quiche/udp_gso_batch_writer.cc +++ b/source/extensions/quic_listeners/quiche/udp_gso_batch_writer.cc @@ -51,9 +51,7 @@ Api::IoCallUint64Result convertQuicWriteResult(quic::WriteResult quic_result, si // Initialize QuicGsoBatchWriter, set io_handle_ and stats_ UdpGsoBatchWriter::UdpGsoBatchWriter(Network::IoHandle& io_handle, Stats::Scope& scope) - : quic::QuicGsoBatchWriter(std::make_unique(), - io_handle.fdDoNotUse()), - stats_(generateStats(scope)) {} + : quic::QuicGsoBatchWriter(io_handle.fdDoNotUse()), stats_(generateStats(scope)) {} // Do Nothing in the Destructor For now UdpGsoBatchWriter::~UdpGsoBatchWriter() = default; diff --git a/test/extensions/quic_listeners/quiche/active_quic_listener_test.cc b/test/extensions/quic_listeners/quiche/active_quic_listener_test.cc index 5d7cfdea89d83..d01148e956ccf 100644 --- a/test/extensions/quic_listeners/quiche/active_quic_listener_test.cc +++ b/test/extensions/quic_listeners/quiche/active_quic_listener_test.cc @@ -88,7 +88,6 @@ class ActiveQuicListenerTest : public QuicMultiVersionTest { bool use_http3 = GetParam().second == QuicVersionType::Iquic; SetQuicReloadableFlag(quic_disable_version_draft_29, !use_http3); SetQuicReloadableFlag(quic_disable_version_draft_27, !use_http3); - SetQuicReloadableFlag(quic_disable_version_draft_25, !use_http3); return quic::CurrentSupportedVersions(); }()[0]) {} diff --git a/test/extensions/quic_listeners/quiche/envoy_quic_client_session_test.cc b/test/extensions/quic_listeners/quiche/envoy_quic_client_session_test.cc index ef50798517dac..803d5494ccc53 100644 --- a/test/extensions/quic_listeners/quiche/envoy_quic_client_session_test.cc +++ b/test/extensions/quic_listeners/quiche/envoy_quic_client_session_test.cc @@ -97,7 +97,6 @@ class EnvoyQuicClientSessionTest : public testing::TestWithParam { alarm_factory_(*dispatcher_, *connection_helper_.GetClock()), quic_version_([]() { SetQuicReloadableFlag(quic_disable_version_draft_29, !GetParam()); SetQuicReloadableFlag(quic_disable_version_draft_27, !GetParam()); - SetQuicReloadableFlag(quic_disable_version_draft_25, !GetParam()); return quic::ParsedVersionOfIndex(quic::CurrentSupportedVersions(), 0); }()), peer_addr_(Network::Utility::getAddressWithPort(*Network::Utility::getIpv6LoopbackAddress(), @@ -215,9 +214,13 @@ TEST_P(EnvoyQuicClientSessionTest, OnGoAwayFrame) { Http::MockResponseDecoder response_decoder; Http::MockStreamCallbacks stream_callbacks; - quic::QuicGoAwayFrame goaway; EXPECT_CALL(http_connection_callbacks_, onGoAway(Http::GoAwayErrorCode::NoError)); - quic_connection_->OnGoAwayFrame(goaway); + if (quic::VersionUsesHttp3(quic_version_[0].transport_version)) { + envoy_quic_session_.OnHttp3GoAway(4u); + } else { + quic::QuicGoAwayFrame goaway; + quic_connection_->OnGoAwayFrame(goaway); + } } TEST_P(EnvoyQuicClientSessionTest, ConnectionClose) { diff --git a/test/extensions/quic_listeners/quiche/envoy_quic_client_stream_test.cc b/test/extensions/quic_listeners/quiche/envoy_quic_client_stream_test.cc index 9784c7231ff28..98359c618b0f5 100644 --- a/test/extensions/quic_listeners/quiche/envoy_quic_client_stream_test.cc +++ b/test/extensions/quic_listeners/quiche/envoy_quic_client_stream_test.cc @@ -27,7 +27,6 @@ class EnvoyQuicClientStreamTest : public testing::TestWithParam { alarm_factory_(*dispatcher_, *connection_helper_.GetClock()), quic_version_([]() { SetQuicReloadableFlag(quic_disable_version_draft_29, !GetParam()); SetQuicReloadableFlag(quic_disable_version_draft_27, !GetParam()); - SetQuicReloadableFlag(quic_disable_version_draft_25, !GetParam()); return quic::CurrentSupportedVersions()[0]; }()), peer_addr_(Network::Utility::getAddressWithPort(*Network::Utility::getIpv6LoopbackAddress(), @@ -231,30 +230,30 @@ TEST_P(EnvoyQuicClientStreamTest, WatermarkSendBuffer) { quic_stream_->encodeData(buffer, false); EXPECT_EQ(0u, buffer.length()); - EXPECT_TRUE(quic_stream_->flow_controller()->IsBlocked()); + EXPECT_TRUE(quic_stream_->IsFlowControlBlocked()); // Receive a WINDOW_UPDATE frame not large enough to drain half of the send // buffer. quic::QuicWindowUpdateFrame window_update1(quic::kInvalidControlFrameId, quic_stream_->id(), 16 * 1024 + 8 * 1024); quic_stream_->OnWindowUpdateFrame(window_update1); - EXPECT_FALSE(quic_stream_->flow_controller()->IsBlocked()); + EXPECT_FALSE(quic_stream_->IsFlowControlBlocked()); quic_session_.OnCanWrite(); - EXPECT_TRUE(quic_stream_->flow_controller()->IsBlocked()); + EXPECT_TRUE(quic_stream_->IsFlowControlBlocked()); // Receive another WINDOW_UPDATE frame to drain the send buffer till below low // watermark. quic::QuicWindowUpdateFrame window_update2(quic::kInvalidControlFrameId, quic_stream_->id(), 16 * 1024 + 8 * 1024 + 1024); quic_stream_->OnWindowUpdateFrame(window_update2); - EXPECT_FALSE(quic_stream_->flow_controller()->IsBlocked()); + EXPECT_FALSE(quic_stream_->IsFlowControlBlocked()); EXPECT_CALL(stream_callbacks_, onBelowWriteBufferLowWatermark()).WillOnce(Invoke([this]() { std::string rest_request(1, 'a'); Buffer::OwnedImpl buffer(rest_request); quic_stream_->encodeData(buffer, true); })); quic_session_.OnCanWrite(); - EXPECT_TRUE(quic_stream_->flow_controller()->IsBlocked()); + EXPECT_TRUE(quic_stream_->IsFlowControlBlocked()); quic::QuicWindowUpdateFrame window_update3(quic::kInvalidControlFrameId, quic_stream_->id(), 32 * 1024 + 1024); @@ -309,7 +308,7 @@ TEST_P(EnvoyQuicClientStreamTest, HeadersContributeToWatermarkIquic) { })); EXPECT_CALL(stream_callbacks_, onBelowWriteBufferLowWatermark()); quic_session_.OnCanWrite(); - EXPECT_TRUE(quic_stream_->flow_controller()->IsBlocked()); + EXPECT_TRUE(quic_stream_->IsFlowControlBlocked()); // Update flow control window to write all the buffered data. quic::QuicWindowUpdateFrame window_update1(quic::kInvalidControlFrameId, quic_stream_->id(), diff --git a/test/extensions/quic_listeners/quiche/envoy_quic_dispatcher_test.cc b/test/extensions/quic_listeners/quiche/envoy_quic_dispatcher_test.cc index 9a9098ea9334e..f133d0c314a5b 100644 --- a/test/extensions/quic_listeners/quiche/envoy_quic_dispatcher_test.cc +++ b/test/extensions/quic_listeners/quiche/envoy_quic_dispatcher_test.cc @@ -67,7 +67,6 @@ class EnvoyQuicDispatcherTest : public QuicMultiVersionTest, bool use_http3 = GetParam().second == QuicVersionType::Iquic; SetQuicReloadableFlag(quic_disable_version_draft_29, !use_http3); SetQuicReloadableFlag(quic_disable_version_draft_27, !use_http3); - SetQuicReloadableFlag(quic_disable_version_draft_25, !use_http3); return quic::CurrentSupportedVersions(); }()), quic_version_(version_manager_.GetSupportedVersions()[0]), diff --git a/test/extensions/quic_listeners/quiche/envoy_quic_server_session_test.cc b/test/extensions/quic_listeners/quiche/envoy_quic_server_session_test.cc index 13ac84877a46c..99bbc024a5d15 100644 --- a/test/extensions/quic_listeners/quiche/envoy_quic_server_session_test.cc +++ b/test/extensions/quic_listeners/quiche/envoy_quic_server_session_test.cc @@ -90,7 +90,7 @@ class ProofSourceDetailsSetter { virtual void setProofSourceDetails(std::unique_ptr details) = 0; }; -class TestQuicCryptoServerStream : public EnvoyQuicCryptoServerStream, +class TestQuicCryptoServerStream : public quic::QuicCryptoServerStream, public ProofSourceDetailsSetter { public: ~TestQuicCryptoServerStream() override = default; @@ -99,11 +99,11 @@ class TestQuicCryptoServerStream : public EnvoyQuicCryptoServerStream, quic::QuicCompressedCertsCache* compressed_certs_cache, quic::QuicSession* session, quic::QuicCryptoServerStreamBase::Helper* helper) - : EnvoyQuicCryptoServerStream(crypto_config, compressed_certs_cache, session, helper) {} + : quic::QuicCryptoServerStream(crypto_config, compressed_certs_cache, session, helper) {} bool encryption_established() const override { return true; } - const EnvoyQuicProofSourceDetails* proofSourceDetails() const override { return details_.get(); } + const EnvoyQuicProofSourceDetails* ProofSourceDetails() const override { return details_.get(); } void setProofSourceDetails(std::unique_ptr details) override { details_ = std::move(details); @@ -113,20 +113,20 @@ class TestQuicCryptoServerStream : public EnvoyQuicCryptoServerStream, std::unique_ptr details_; }; -class TestEnvoyQuicTlsServerHandshaker : public EnvoyQuicTlsServerHandshaker, +class TestEnvoyQuicTlsServerHandshaker : public quic::TlsServerHandshaker, public ProofSourceDetailsSetter { public: ~TestEnvoyQuicTlsServerHandshaker() override = default; TestEnvoyQuicTlsServerHandshaker(quic::QuicSession* session, const quic::QuicCryptoServerConfig& crypto_config) - : EnvoyQuicTlsServerHandshaker(session, crypto_config), + : quic::TlsServerHandshaker(session, crypto_config), params_(new quic::QuicCryptoNegotiatedParameters) { params_->cipher_suite = 1; } bool encryption_established() const override { return true; } - const EnvoyQuicProofSourceDetails* proofSourceDetails() const override { return details_.get(); } + const EnvoyQuicProofSourceDetails* ProofSourceDetails() const override { return details_.get(); } void setProofSourceDetails(std::unique_ptr details) override { details_ = std::move(details); } @@ -147,7 +147,6 @@ class EnvoyQuicServerSessionTest : public testing::TestWithParam { alarm_factory_(*dispatcher_, *connection_helper_.GetClock()), quic_version_([]() { SetQuicReloadableFlag(quic_disable_version_draft_29, !GetParam()); SetQuicReloadableFlag(quic_disable_version_draft_27, !GetParam()); - SetQuicReloadableFlag(quic_disable_version_draft_25, !GetParam()); return quic::ParsedVersionOfIndex(quic::CurrentSupportedVersions(), 0); }()), quic_connection_(new TestEnvoyQuicServerConnection( @@ -506,7 +505,7 @@ TEST_P(EnvoyQuicServerSessionTest, WriteUpdatesDelayCloseTimer) { stream->encodeData(buffer, false); // Stream become write blocked. EXPECT_TRUE(envoy_quic_session_.HasDataToWrite()); - EXPECT_TRUE(stream->flow_controller()->IsBlocked()); + EXPECT_TRUE(stream->IsFlowControlBlocked()); EXPECT_FALSE(envoy_quic_session_.IsConnectionFlowControlBlocked()); // Connection shouldn't be closed right away as there is a stream write blocked. @@ -599,7 +598,7 @@ TEST_P(EnvoyQuicServerSessionTest, FlushCloseNoTimeout) { stream->encodeData(buffer, true); // Stream become write blocked. EXPECT_TRUE(envoy_quic_session_.HasDataToWrite()); - EXPECT_TRUE(stream->flow_controller()->IsBlocked()); + EXPECT_TRUE(stream->IsFlowControlBlocked()); EXPECT_FALSE(envoy_quic_session_.IsConnectionFlowControlBlocked()); // Connection shouldn't be closed right away as there is a stream write blocked. @@ -795,10 +794,8 @@ TEST_P(EnvoyQuicServerSessionTest, InitializeFilterChain) { if (!quic_version_[0].UsesTls()) { envoy_quic_session_.SetDefaultEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE); } else { - if (quic::VersionUsesHttp3(quic_version_[0].transport_version)) { - EXPECT_CALL(*quic_connection_, SendControlFrame(_)); - } - envoy_quic_session_.OnOneRttKeysAvailable(); + EXPECT_CALL(*quic_connection_, SendControlFrame(_)); + envoy_quic_session_.OnTlsHandshakeComplete(); } EXPECT_EQ(nullptr, envoy_quic_session_.socketOptions()); EXPECT_TRUE(quic_connection_->connectionSocket()->ioHandle().isOpen()); @@ -877,7 +874,7 @@ TEST_P(EnvoyQuicServerSessionTest, SendBufferWatermark) { Buffer::OwnedImpl buffer(response); EXPECT_CALL(stream_callbacks, onAboveWriteBufferHighWatermark()); stream1->encodeData(buffer, false); - EXPECT_TRUE(stream1->flow_controller()->IsBlocked()); + EXPECT_TRUE(stream1->IsFlowControlBlocked()); EXPECT_FALSE(envoy_quic_session_.IsConnectionFlowControlBlocked()); // Receive another request and send back response to trigger connection level @@ -943,7 +940,7 @@ TEST_P(EnvoyQuicServerSessionTest, SendBufferWatermark) { stream1->encodeData(buffer, true); })); envoy_quic_session_.OnCanWrite(); - EXPECT_TRUE(stream1->flow_controller()->IsBlocked()); + EXPECT_TRUE(stream1->IsFlowControlBlocked()); // Update flow control window for stream2. quic::QuicWindowUpdateFrame window_update2(quic::kInvalidControlFrameId, stream2->id(), @@ -974,7 +971,7 @@ TEST_P(EnvoyQuicServerSessionTest, SendBufferWatermark) { })); EXPECT_CALL(network_connection_callbacks_, onAboveWriteBufferHighWatermark()); envoy_quic_session_.OnCanWrite(); - EXPECT_TRUE(stream2->flow_controller()->IsBlocked()); + EXPECT_TRUE(stream2->IsFlowControlBlocked()); // Resetting stream3 should lower the buffered bytes, but callbacks will not // be triggered because reset callback has been already triggered. @@ -1082,7 +1079,7 @@ TEST_P(EnvoyQuicServerSessionTest, HeadersContributeToWatermarkGquic) { [this]() { http_connection_->onUnderlyingConnectionBelowWriteBufferLowWatermark(); })); EXPECT_CALL(stream_callbacks, onBelowWriteBufferLowWatermark()).Times(2); envoy_quic_session_.OnCanWrite(); - EXPECT_TRUE(stream1->flow_controller()->IsBlocked()); + EXPECT_TRUE(stream1->IsFlowControlBlocked()); // Buffer more response because of flow control. The buffered bytes become just below connection // level high watermark. diff --git a/test/extensions/quic_listeners/quiche/envoy_quic_server_stream_test.cc b/test/extensions/quic_listeners/quiche/envoy_quic_server_stream_test.cc index 4a4236737bd00..153b45b91fbc4 100644 --- a/test/extensions/quic_listeners/quiche/envoy_quic_server_stream_test.cc +++ b/test/extensions/quic_listeners/quiche/envoy_quic_server_stream_test.cc @@ -42,7 +42,6 @@ class EnvoyQuicServerStreamTest : public testing::TestWithParam { alarm_factory_(*dispatcher_, *connection_helper_.GetClock()), quic_version_([]() { SetQuicReloadableFlag(quic_disable_version_draft_29, !GetParam()); SetQuicReloadableFlag(quic_disable_version_draft_27, !GetParam()); - SetQuicReloadableFlag(quic_disable_version_draft_25, !GetParam()); return quic::CurrentSupportedVersions()[0]; }()), listener_stats_({ALL_LISTENER_STATS(POOL_COUNTER(listener_config_.listenerScope()), @@ -344,30 +343,30 @@ TEST_P(EnvoyQuicServerStreamTest, WatermarkSendBuffer) { quic_stream_->encodeData(buffer, false); EXPECT_EQ(0u, buffer.length()); - EXPECT_TRUE(quic_stream_->flow_controller()->IsBlocked()); + EXPECT_TRUE(quic_stream_->IsFlowControlBlocked()); // Receive a WINDOW_UPDATE frame not large enough to drain half of the send // buffer. quic::QuicWindowUpdateFrame window_update1(quic::kInvalidControlFrameId, quic_stream_->id(), 16 * 1024 + 8 * 1024); quic_stream_->OnWindowUpdateFrame(window_update1); - EXPECT_FALSE(quic_stream_->flow_controller()->IsBlocked()); + EXPECT_FALSE(quic_stream_->IsFlowControlBlocked()); quic_session_.OnCanWrite(); - EXPECT_TRUE(quic_stream_->flow_controller()->IsBlocked()); + EXPECT_TRUE(quic_stream_->IsFlowControlBlocked()); // Receive another WINDOW_UPDATE frame to drain the send buffer till below low // watermark. quic::QuicWindowUpdateFrame window_update2(quic::kInvalidControlFrameId, quic_stream_->id(), 16 * 1024 + 8 * 1024 + 1024); quic_stream_->OnWindowUpdateFrame(window_update2); - EXPECT_FALSE(quic_stream_->flow_controller()->IsBlocked()); + EXPECT_FALSE(quic_stream_->IsFlowControlBlocked()); EXPECT_CALL(stream_callbacks_, onBelowWriteBufferLowWatermark()).WillOnce(Invoke([this]() { std::string rest_response(1, 'a'); Buffer::OwnedImpl buffer(rest_response); quic_stream_->encodeData(buffer, true); })); quic_session_.OnCanWrite(); - EXPECT_TRUE(quic_stream_->flow_controller()->IsBlocked()); + EXPECT_TRUE(quic_stream_->IsFlowControlBlocked()); quic::QuicWindowUpdateFrame window_update3(quic::kInvalidControlFrameId, quic_stream_->id(), 32 * 1024 + 1024); @@ -420,7 +419,7 @@ TEST_P(EnvoyQuicServerStreamTest, HeadersContributeToWatermarkIquic) { })); EXPECT_CALL(stream_callbacks_, onBelowWriteBufferLowWatermark()); quic_session_.OnCanWrite(); - EXPECT_TRUE(quic_stream_->flow_controller()->IsBlocked()); + EXPECT_TRUE(quic_stream_->IsFlowControlBlocked()); // Update flow control window to write all the buffered data. quic::QuicWindowUpdateFrame window_update1(quic::kInvalidControlFrameId, quic_stream_->id(), diff --git a/test/extensions/quic_listeners/quiche/integration/quic_http_integration_test.cc b/test/extensions/quic_listeners/quiche/integration/quic_http_integration_test.cc index ac41e254cda73..6268981d4c247 100644 --- a/test/extensions/quic_listeners/quiche/integration/quic_http_integration_test.cc +++ b/test/extensions/quic_listeners/quiche/integration/quic_http_integration_test.cc @@ -102,7 +102,6 @@ class QuicHttpIntegrationTest : public HttpIntegrationTest, public QuicMultiVers bool use_http3 = GetParam().second == QuicVersionType::Iquic; SetQuicReloadableFlag(quic_disable_version_draft_29, !use_http3); SetQuicReloadableFlag(quic_disable_version_draft_27, !use_http3); - SetQuicReloadableFlag(quic_disable_version_draft_25, !use_http3); return quic::CurrentSupportedVersions(); }()), conn_helper_(*dispatcher_), alarm_factory_(*dispatcher_, *conn_helper_.GetClock()),