Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(872)

Unified Diff: net/quic/quic_stream_factory.cc

Issue 1833093002: Disable connection migration if disabled in config sent by server. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Unnecessary error code removed. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/quic/quic_stream_factory_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_stream_factory.cc
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index a032f2e9f33ad13a7056b3af3978fadddeeacc0a..1f4a368bc7a116091ac03dcc358fba4a09521517 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -84,6 +84,7 @@ enum QuicConnectionMigrationStatus {
MIGRATION_STATUS_TOO_MANY_CHANGES,
MIGRATION_STATUS_SUCCESS,
MIGRATION_STATUS_NON_MIGRATABLE_STREAM,
+ MIGRATION_STATUS_DISABLED,
MIGRATION_STATUS_MAX
};
@@ -1343,6 +1344,17 @@ void QuicStreamFactory::MaybeMigrateOrCloseSessions(NetworkHandle network,
}
continue;
}
+ if (session->config()->DisableConnectionMigration()) {
+ // Do not migrate sessions where connection migration is disabled by
+ // config.
+ if (force_close) {
+ // Close sessions where connection migration is disabled.
+ session->CloseSessionOnError(ERR_NETWORK_CHANGED,
+ QUIC_IP_ADDRESS_CHANGED);
+ HistogramMigrationStatus(MIGRATION_STATUS_DISABLED);
+ }
+ continue;
+ }
if (session->HasNonMigratableStreams()) {
// Do not migrate sessions with non-migratable streams.
if (force_close) {
@@ -1361,7 +1373,8 @@ void QuicStreamFactory::MaybeMigrateOrCloseSessions(NetworkHandle network,
void QuicStreamFactory::MaybeMigrateSessionEarly(
QuicChromiumClientSession* session) {
- if (!migrate_sessions_early_ || session->HasNonMigratableStreams()) {
+ if (!migrate_sessions_early_ || session->HasNonMigratableStreams() ||
+ session->config()->DisableConnectionMigration()) {
return;
}
NetworkHandle new_network =
« no previous file with comments | « no previous file | net/quic/quic_stream_factory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698