Add QuicConfig::KeyUpdateSupportedRemotely getter. PiperOrigin-RevId: 338721786 Change-Id: I9b7e47138fa67d4b642d0e4a28119a5cc4cbbb58
diff --git a/quic/core/quic_config.cc b/quic/core/quic_config.cc index 60569b3..3e833ea 100644 --- a/quic/core/quic_config.cc +++ b/quic/core/quic_config.cc
@@ -870,13 +870,17 @@ } bool QuicConfig::KeyUpdateSupportedForConnection() const { - return key_update_supported_remotely_ && KeyUpdateSupportedLocally(); + return KeyUpdateSupportedRemotely() && KeyUpdateSupportedLocally(); } bool QuicConfig::KeyUpdateSupportedLocally() const { return key_update_supported_locally_; } +bool QuicConfig::KeyUpdateSupportedRemotely() const { + return key_update_supported_remotely_; +} + void QuicConfig::SetIPv6AlternateServerAddressToSend( const QuicSocketAddress& alternate_server_address_ipv6) { if (!alternate_server_address_ipv6.host().IsIPv6()) {
diff --git a/quic/core/quic_config.h b/quic/core/quic_config.h index 016d5d0..6e9eee1 100644 --- a/quic/core/quic_config.h +++ b/quic/core/quic_config.h
@@ -391,6 +391,7 @@ void SetKeyUpdateSupportedLocally(); bool KeyUpdateSupportedForConnection() const; bool KeyUpdateSupportedLocally() const; + bool KeyUpdateSupportedRemotely() const; // IPv6 alternate server address. void SetIPv6AlternateServerAddressToSend(
diff --git a/quic/core/quic_config_test.cc b/quic/core/quic_config_test.cc index 73e8d97..f7f1618 100644 --- a/quic/core/quic_config_test.cc +++ b/quic/core/quic_config_test.cc
@@ -57,6 +57,7 @@ EXPECT_FALSE(config_.HasReceivedMaxPacketSize()); EXPECT_FALSE(config_.KeyUpdateSupportedForConnection()); EXPECT_FALSE(config_.KeyUpdateSupportedLocally()); + EXPECT_FALSE(config_.KeyUpdateSupportedRemotely()); } TEST_P(QuicConfigTest, AutoSetIetfFlowControl) { @@ -682,6 +683,7 @@ } EXPECT_FALSE(config_.KeyUpdateSupportedForConnection()); EXPECT_FALSE(config_.KeyUpdateSupportedLocally()); + EXPECT_FALSE(config_.KeyUpdateSupportedRemotely()); TransportParameters params; params.key_update_not_yet_supported = true; std::string error_details; @@ -690,6 +692,7 @@ IsQuicNoError()); EXPECT_FALSE(config_.KeyUpdateSupportedForConnection()); EXPECT_FALSE(config_.KeyUpdateSupportedLocally()); + EXPECT_FALSE(config_.KeyUpdateSupportedRemotely()); } TEST_P(QuicConfigTest, KeyUpdateNotYetSupportedTransportParameter) { @@ -727,6 +730,7 @@ IsQuicNoError()); EXPECT_FALSE(config_.KeyUpdateSupportedForConnection()); EXPECT_FALSE(config_.KeyUpdateSupportedLocally()); + EXPECT_TRUE(config_.KeyUpdateSupportedRemotely()); } TEST_P(QuicConfigTest, KeyUpdateSupported) { @@ -746,6 +750,7 @@ IsQuicNoError()); EXPECT_TRUE(config_.KeyUpdateSupportedForConnection()); EXPECT_TRUE(config_.KeyUpdateSupportedLocally()); + EXPECT_TRUE(config_.KeyUpdateSupportedRemotely()); } } // namespace