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

Unified Diff: net/quic/quic_stream_factory.cc

Issue 2124753005: Implements migration of a QUIC connection to a different destination address if specified by the se… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@write-error
Patch Set: Created 4 years, 5 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
Index: net/quic/quic_stream_factory.cc
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index 2890f63bb0f608637a0a3b801703d9ad08fc22a1..cb9d3fcd3fa49c81b12c513fa5dac97999740891 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -1443,7 +1443,8 @@ void QuicStreamFactory::MaybeMigrateOrCloseSessions(
continue;
}
- MigrateSessionToNetwork(session, new_network, bound_net_log, nullptr);
+ MigrateSessionToNewSocket(session, session->connection()->peer_address(),
+ new_network, bound_net_log, nullptr);
}
}
@@ -1475,13 +1476,14 @@ void QuicStreamFactory::MaybeMigrateSingleSession(
return;
}
OnSessionGoingAway(session);
- MigrateSessionToNetwork(session, new_network, scoped_event_log.net_log(),
- packet);
+ MigrateSessionToNewSocket(session, session->connection()->peer_address(),
+ new_network, scoped_event_log.net_log(), packet);
}
-void QuicStreamFactory::MigrateSessionToNetwork(
+void QuicStreamFactory::MigrateSessionToNewSocket(
Ryan Hamilton 2016/07/06 19:29:37 (Alternative name "MigrateSession"?)
Jana 2016/07/12 22:34:10 Done.
QuicChromiumClientSession* session,
- NetworkHandle new_network,
+ IPEndPoint peer_address,
+ NetworkHandle network,
const BoundNetLog& bound_net_log,
scoped_refptr<StringIOBuffer> packet) {
// Use OS-specified port for socket (DEFAULT_BIND) instead of
@@ -1491,9 +1493,7 @@ void QuicStreamFactory::MigrateSessionToNetwork(
client_socket_factory_->CreateDatagramClientSocket(
DatagramSocket::DEFAULT_BIND, RandIntCallback(),
session->net_log().net_log(), session->net_log().source()));
- QuicConnection* connection = session->connection();
- if (ConfigureSocket(socket.get(), connection->peer_address(), new_network) !=
- OK) {
+ if (ConfigureSocket(socket.get(), peer_address, network) != OK) {
session->CloseSessionOnError(ERR_NETWORK_CHANGED, QUIC_INTERNAL_ERROR);
HistogramAndLogMigrationFailure(
bound_net_log, MIGRATION_STATUS_INTERNAL_ERROR,

Powered by Google App Engine
This is Rietveld 408576698