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

Unified Diff: net/quic/quic_client_session.cc

Issue 1025573002: QUIC - disable QUIC if packet loss rate is bad for a connection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable quic when there is high packet loss rate Created 5 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/quic_client_session.cc
diff --git a/net/quic/quic_client_session.cc b/net/quic/quic_client_session.cc
index 0625f08077d30c5c7c62a77e5668a72b8ee1c2d6..5c97667dc40ae84a697ddf3c04529f4e618430b9 100644
--- a/net/quic/quic_client_session.cc
+++ b/net/quic/quic_client_session.cc
@@ -593,6 +593,21 @@ void QuicClientSession::OnClosedStream() {
}
void QuicClientSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) {
+ if (stream_factory_ && event == HANDSHAKE_CONFIRMED) {
+ float packet_loss_rate = logger_->PacketLossRate() / 10;
Ryan Hamilton 2015/03/23 02:31:06 Why / 10?
ramant (doing other things) 2015/03/24 03:07:22 Remove the percent. Used fraction.
+ if (packet_loss_rate > stream_factory_->packet_loss_threshold()) {
+ stream_factory_->OnBadPacketLoss(server_id_);
Ryan Hamilton 2015/03/23 02:31:06 I wonder if it might make more sense for this to b
ramant (doing other things) 2015/03/24 03:07:22 Done.
+ // We abandon the connection if packet loss rate is too bad.
+ DVLOG(1) << "Closing session on bad packet loss rate: "
+ << packet_loss_rate;
+ UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.HasBadPacketLossRate", true);
+ NotifyFactoryOfSessionGoingAway();
+ CloseSessionOnErrorInner(ERR_ABORTED, QUIC_BAD_PACKET_LOSS_RATE);
+ NotifyFactoryOfSessionClosedLater();
Ryan Hamilton 2015/03/23 02:31:06 Is there a method the factory could call which wou
ramant (doing other things) 2015/03/24 03:07:22 Called CloseSessionOnError from QuicStreamFactory.
+ return;
+ }
+ }
+
if (!callback_.is_null() &&
(!require_confirmation_ ||
event == HANDSHAKE_CONFIRMED || event == ENCRYPTION_REESTABLISHED)) {

Powered by Google App Engine
This is Rietveld 408576698