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

Unified Diff: net/quic/quic_stream_factory.cc

Issue 579533003: Correctly fix a bug when a QUIC session is closed during the call to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 6 years, 3 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 | no next file » | 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 dd327df00c8ca72557a50e7b9df7224e2fb5e213..6f71095fe9556a900a2ee9c6f85a2cbb5903b317 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -380,6 +380,10 @@ int QuicStreamFactory::Job::DoConnect() {
return rv;
}
+ if (!session_->connection()->connected()) {
+ return ERR_CONNECTION_CLOSED;
+ }
+
session_->StartReading();
if (!session_->connection()->connected()) {
return ERR_QUIC_PROTOCOL_ERROR;
@@ -896,7 +900,9 @@ int QuicStreamFactory::CreateSession(
all_sessions_[*session] = server_id; // owning pointer
(*session)->InitializeSession(server_id, &crypto_config_,
quic_crypto_client_stream_factory_);
- bool closed_during_initialize = !ContainsKey(all_sessions_, *session);
+ bool closed_during_initialize =
+ !ContainsKey(all_sessions_, *session) ||
+ !(*session)->connection()->connected();
UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.ClosedDuringInitializeSession",
closed_during_initialize);
if (closed_during_initialize) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698