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

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

Issue 2766603004: QUIC: mark QUIC handshake failed if connection is closed after CryptoConnect (Closed)
Patch Set: address xunjieli's comments Created 3 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
Index: net/quic/chromium/quic_chromium_client_session.cc
diff --git a/net/quic/chromium/quic_chromium_client_session.cc b/net/quic/chromium/quic_chromium_client_session.cc
index d783551a80145c58032a9ce31a09b2446bc0f9d6..d1d218550204bf5bbe4cdf340724960d2ff7ac43 100644
--- a/net/quic/chromium/quic_chromium_client_session.cc
+++ b/net/quic/chromium/quic_chromium_client_session.cc
@@ -670,6 +670,13 @@ int QuicChromiumClientSession::CryptoConnect(
DCHECK(flow_controller());
crypto_stream_->CryptoConnect();
+ // Check if the connection is still open, issues during CryptoConnect like
+ // packet write error could cause the connection to be torn down. Return
+ // synchronously with ERR_QUIC_HANDSHAKE_FAILED so that QuicStreamFactory::Job
xunjieli 2017/03/23 17:43:37 mentioning QuicStreamFacory::Job here is a layerin
Zhongyi Shi 2017/03/23 19:20:32 QuicCryptoClientStream::CryptoConnect() is shared
+ // could fail without hanging.
+ if (!connection()->connected())
+ return ERR_QUIC_HANDSHAKE_FAILED;
+
if (IsCryptoHandshakeConfirmed()) {
connect_timing_.connect_end = base::TimeTicks::Now();
return OK;
« no previous file with comments | « net/quic/chromium/mock_crypto_client_stream_factory.cc ('k') | net/quic/chromium/quic_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698