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

Unified Diff: net/quic/quic_stream_factory.cc

Issue 23279011: Require handshake confirmation until a QUIC connection is created succesfully when using a new netw… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added test Created 7 years, 4 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 fba7f0b7dec9e26ae73227270030ad9924ff7a35..7659e9521307beab0d24817aad2bde04216127d0 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -226,6 +226,7 @@ int QuicStreamFactory::Job::DoConnect() {
cert_verifier_, address_list_, net_log_);
session_->StartReading();
int rv = session_->CryptoConnect(
+ factory_->require_confirmation(),
base::Bind(&QuicStreamFactory::Job::OnIOComplete,
base::Unretained(this)));
return rv;
@@ -247,7 +248,8 @@ QuicStreamFactory::QuicStreamFactory(
QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory,
QuicRandom* random_generator,
QuicClock* clock)
- : host_resolver_(host_resolver),
+ : require_confirmation_(true),
+ host_resolver_(host_resolver),
client_socket_factory_(client_socket_factory),
quic_crypto_client_stream_factory_(quic_crypto_client_stream_factory),
random_generator_(random_generator),
@@ -301,6 +303,7 @@ int QuicStreamFactory::Create(const HostPortProxyPair& host_port_proxy_pair,
void QuicStreamFactory::OnJobComplete(Job* job, int rv) {
if (rv == OK) {
+ require_confirmation_ = false;
// Create all the streams, but do not notify them yet.
for (RequestSet::iterator it = job_requests_map_[job].begin();
it != job_requests_map_[job].end() ; ++it) {
@@ -393,6 +396,7 @@ base::Value* QuicStreamFactory::QuicStreamFactoryInfoToValue() const {
void QuicStreamFactory::OnIPAddressChanged() {
CloseAllSessions(ERR_NETWORK_CHANGED);
+ require_confirmation_ = true;
}
bool QuicStreamFactory::HasActiveSession(

Powered by Google App Engine
This is Rietveld 408576698