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

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

Issue 2789093003: Mark QUIC broken when the network blackholes after the handshake (Closed)
Patch Set: jana's comments Created 3 years, 8 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 | « net/quic/chromium/quic_stream_factory.h ('k') | net/quic/chromium/quic_stream_factory_peer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0f855f0aad2fc91b2dbd342ed323617889c9626e..969aa43386c3df224f63f86576de5f28c8f7ce55 100644
--- a/net/quic/chromium/quic_stream_factory.cc
+++ b/net/quic/chromium/quic_stream_factory.cc
@@ -724,6 +724,7 @@ QuicStreamFactory::QuicStreamFactory(
bool delay_tcp_race,
int max_server_configs_stored_in_properties,
bool close_sessions_on_ip_change,
+ bool mark_quic_broken_when_network_blackholes,
int idle_connection_timeout_seconds,
int reduced_ping_timeout_seconds,
int packet_reader_yield_after_duration_milliseconds,
@@ -768,6 +769,8 @@ QuicStreamFactory::QuicStreamFactory(
enable_non_blocking_io_(enable_non_blocking_io),
disable_disk_cache_(disable_disk_cache),
prefer_aes_(prefer_aes),
+ mark_quic_broken_when_network_blackholes_(
+ mark_quic_broken_when_network_blackholes),
socket_receive_buffer_size_(socket_receive_buffer_size),
delay_tcp_race_(delay_tcp_race),
ping_timeout_(QuicTime::Delta::FromSeconds(kPingTimeoutSecs)),
@@ -1152,8 +1155,8 @@ void QuicStreamFactory::OnCertVerifyJobComplete(CertVerifierJob* job, int rv) {
std::unique_ptr<QuicHttpStream> QuicStreamFactory::CreateFromSession(
QuicChromiumClientSession* session) {
- return std::unique_ptr<QuicHttpStream>(
- new QuicHttpStream(session->GetWeakPtr(), http_server_properties_));
+ return base::MakeUnique<QuicHttpStream>(session->GetWeakPtr(),
+ http_server_properties_);
}
void QuicStreamFactory::OnIdleSession(QuicChromiumClientSession* session) {}
@@ -1192,10 +1195,15 @@ void QuicStreamFactory::OnSessionClosed(QuicChromiumClientSession* session) {
all_sessions_.erase(session);
}
-void QuicStreamFactory::OnTimeoutWithOpenStreams() {
- // Reduce PING timeout when connection times out with open stream.
- if (ping_timeout_ > reduced_ping_timeout_) {
+void QuicStreamFactory::OnBlackholeAfterHandshakeConfirmed(
+ QuicChromiumClientSession* session) {
+ // Reduce PING timeout when connection blackholes after the handshake.
+ if (ping_timeout_ > reduced_ping_timeout_)
ping_timeout_ = reduced_ping_timeout_;
+
+ if (mark_quic_broken_when_network_blackholes_) {
+ http_server_properties_->MarkAlternativeServiceBroken(
+ AlternativeService(kProtoQUIC, session->server_id().host_port_pair()));
}
}
@@ -1858,6 +1866,10 @@ void QuicStreamFactory::ProcessGoingAwaySession(
server_id.host_port_pair());
url::SchemeHostPort server("https", server_id.host_port_pair().host(),
server_id.host_port_pair().port());
+ // Do nothing if QUIC is currently marked as broken.
+ if (http_server_properties_->IsAlternativeServiceBroken(alternative_service))
+ return;
+
if (session->IsCryptoHandshakeConfirmed()) {
http_server_properties_->ConfirmAlternativeService(alternative_service);
ServerNetworkStats network_stats;
« no previous file with comments | « net/quic/chromium/quic_stream_factory.h ('k') | net/quic/chromium/quic_stream_factory_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698