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

Unified Diff: net/quic/chromium/quic_stream_factory.cc

Issue 2487973003: GOAWAY open QUIC sessions if clock skew is detected (Closed)
Patch Set: format Created 4 years, 1 month 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/chromium/quic_stream_factory.cc
diff --git a/net/quic/chromium/quic_stream_factory.cc b/net/quic/chromium/quic_stream_factory.cc
index 339ea7e81934fc7172b51bdac91ff2b1aadff45e..1e283f527722564cdc47346f569aab76643e997e 100644
--- a/net/quic/chromium/quic_stream_factory.cc
+++ b/net/quic/chromium/quic_stream_factory.cc
@@ -753,6 +753,7 @@ QuicStreamFactory::QuicStreamFactory(
random_generator_(random_generator),
clock_(clock),
max_packet_length_(max_packet_length),
+ clock_skew_detector_(base::TimeTicks::Now(), base::Time::Now()),
socket_performance_watcher_factory_(socket_performance_watcher_factory),
config_(InitializeQuicConfig(connection_options,
idle_connection_timeout_seconds)),
@@ -925,6 +926,14 @@ int QuicStreamFactory::Create(const QuicServerId& server_id,
base::StringPiece method,
const NetLogWithSource& net_log,
QuicStreamRequest* request) {
+ if (clock_skew_detector_.ClockSkewDetected(base::TimeTicks::Now(),
+ base::Time::Now())) {
+ while (!active_sessions_.empty()) {
+ QuicChromiumClientSession* session = active_sessions_.begin()->second;
+ OnSessionGoingAway(session);
+ // TODO(rch): actually close the session?
+ }
+ }
DCHECK(server_id.host_port_pair().Equals(HostPortPair::FromURL(url)));
// Enforce session affinity for promised streams.
QuicClientPromisedInfo* promised =

Powered by Google App Engine
This is Rietveld 408576698