Close sessions on ip change: #1220 closes quic connections by default when changing networks
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Tue, 18 Jun 2024 14:14:06 +0000
|
||||
Subject: Close sessions on ip change
|
||||
|
||||
Exposed a flag to change the behaviour of the network stack with regard
|
||||
to the automatic reconnection of quic connections when the connection changes.
|
||||
By default changed from automatic reconnection to close connection on ip change.
|
||||
No change in doh connections.
|
||||
|
||||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
---
|
||||
.../browser/network_session_configurator.cc | 11 ++++-------
|
||||
.../about_flags_cc/Close-Sessions-On-Ip-Change.inc | 14 ++++++++++++++
|
||||
.../features_cc/Close-Sessions-On-Ip-Change.inc | 5 +++++
|
||||
.../features_h/Close-Sessions-On-Ip-Change.inc | 3 +++
|
||||
net/base/features.cc | 2 +-
|
||||
5 files changed, 27 insertions(+), 8 deletions(-)
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Close-Sessions-On-Ip-Change.inc
|
||||
create mode 100644 cromite_flags/net/base/features_cc/Close-Sessions-On-Ip-Change.inc
|
||||
create mode 100644 cromite_flags/net/base/features_h/Close-Sessions-On-Ip-Change.inc
|
||||
|
||||
diff --git a/components/network_session_configurator/browser/network_session_configurator.cc b/components/network_session_configurator/browser/network_session_configurator.cc
|
||||
--- a/components/network_session_configurator/browser/network_session_configurator.cc
|
||||
+++ b/components/network_session_configurator/browser/network_session_configurator.cc
|
||||
@@ -219,9 +219,8 @@ quic::QuicTagVector GetQuicClientConnectionOptions(
|
||||
|
||||
bool ShouldQuicCloseSessionsOnIpChange(
|
||||
const VariationParameters& quic_trial_params) {
|
||||
- return base::EqualsCaseInsensitiveASCII(
|
||||
- GetVariationParam(quic_trial_params, "close_sessions_on_ip_change"),
|
||||
- "true");
|
||||
+ return base::FeatureList::IsEnabled(
|
||||
+ net::features::kCloseSessionsOnIpChange);
|
||||
}
|
||||
|
||||
bool ShouldQuicGoAwaySessionsOnIpChange(
|
||||
@@ -302,10 +301,8 @@ bool ShouldQuicEstimateInitialRtt(
|
||||
|
||||
bool ShouldQuicMigrateSessionsOnNetworkChangeV2(
|
||||
const VariationParameters& quic_trial_params) {
|
||||
- return GetVariationBoolParamOrFeatureSetting(
|
||||
- quic_trial_params, "migrate_sessions_on_network_change_v2",
|
||||
- base::FeatureList::IsEnabled(
|
||||
- net::features::kMigrateSessionsOnNetworkChangeV2));
|
||||
+ return base::FeatureList::IsEnabled(
|
||||
+ net::features::kMigrateSessionsOnNetworkChangeV2);
|
||||
}
|
||||
|
||||
bool ShouldQuicUseNewAlpsCodepoint(
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Close-Sessions-On-Ip-Change.inc b/cromite_flags/chrome/browser/about_flags_cc/Close-Sessions-On-Ip-Change.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/Close-Sessions-On-Ip-Change.inc
|
||||
@@ -0,0 +1,14 @@
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
+ {"close-sessions-on-ip-change",
|
||||
+ "Close sessions on IP change",
|
||||
+ "Option to close QUIC sessions on an IP address change, "
|
||||
+ "when QUIC connection migration is not enabled.", kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(net::features::kCloseSessionsOnIpChange)},
|
||||
+
|
||||
+ {"migrate-sessions-on-network-change-v2",
|
||||
+ "QUIC connection migration",
|
||||
+ "Enable QUIC connection migration.", kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(net::features::kMigrateSessionsOnNetworkChangeV2)},
|
||||
+
|
||||
+#endif
|
||||
diff --git a/cromite_flags/net/base/features_cc/Close-Sessions-On-Ip-Change.inc b/cromite_flags/net/base/features_cc/Close-Sessions-On-Ip-Change.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/net/base/features_cc/Close-Sessions-On-Ip-Change.inc
|
||||
@@ -0,0 +1,5 @@
|
||||
+CROMITE_FEATURE(kCloseSessionsOnIpChange,
|
||||
+ "CloseSessionsOnIpChange",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+
|
||||
+SET_CROMITE_FEATURE_DISABLED(kMigrateSessionsOnNetworkChangeV2);
|
||||
diff --git a/cromite_flags/net/base/features_h/Close-Sessions-On-Ip-Change.inc b/cromite_flags/net/base/features_h/Close-Sessions-On-Ip-Change.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/net/base/features_h/Close-Sessions-On-Ip-Change.inc
|
||||
@@ -0,0 +1,3 @@
|
||||
+NET_EXPORT BASE_DECLARE_FEATURE(kCloseSessionsOnIpChange);
|
||||
+
|
||||
+NET_EXPORT BASE_DECLARE_FEATURE(kMigrateSessionsOnNetworkChangeV2);
|
||||
diff --git a/net/base/features.cc b/net/base/features.cc
|
||||
--- a/net/base/features.cc
|
||||
+++ b/net/base/features.cc
|
||||
@@ -447,7 +447,7 @@ const base::FeatureParam<bool> kIpPrivacyFallbackToDirect{
|
||||
// NetworkChangeNotifier::AreNetworkHandlesSupported).
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
inline constexpr auto kMigrateSessionsOnNetworkChangeV2Default =
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT;
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT;
|
||||
#else // !BUILDFLAG(IS_ANDROID)
|
||||
inline constexpr auto kMigrateSessionsOnNetworkChangeV2Default =
|
||||
base::FEATURE_DISABLED_BY_DEFAULT;
|
||||
--
|
||||
Reference in New Issue
Block a user