Commit eaa3d4fa authored by rch's avatar rch Committed by Commit bot

Correctly fix a bug when a QUIC session is closed during the call to

InitializeSession. This seems to be able to happen if too much time
elapses between the call to the constructor and the call to InitializeSession.

This fixes the fix from https://codereview.chromium.org/560913002

BUG=399147

Review URL: https://codereview.chromium.org/579533003

Cr-Commit-Position: refs/heads/master@{#295601}
parent c859f18f
...@@ -380,6 +380,10 @@ int QuicStreamFactory::Job::DoConnect() { ...@@ -380,6 +380,10 @@ int QuicStreamFactory::Job::DoConnect() {
return rv; return rv;
} }
if (!session_->connection()->connected()) {
return ERR_CONNECTION_CLOSED;
}
session_->StartReading(); session_->StartReading();
if (!session_->connection()->connected()) { if (!session_->connection()->connected()) {
return ERR_QUIC_PROTOCOL_ERROR; return ERR_QUIC_PROTOCOL_ERROR;
...@@ -896,7 +900,9 @@ int QuicStreamFactory::CreateSession( ...@@ -896,7 +900,9 @@ int QuicStreamFactory::CreateSession(
all_sessions_[*session] = server_id; // owning pointer all_sessions_[*session] = server_id; // owning pointer
(*session)->InitializeSession(server_id, &crypto_config_, (*session)->InitializeSession(server_id, &crypto_config_,
quic_crypto_client_stream_factory_); 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", UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.ClosedDuringInitializeSession",
closed_during_initialize); closed_during_initialize);
if (closed_during_initialize) { if (closed_during_initialize) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment