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

Unified Diff: net/quic/quic_connection.cc

Issue 667573006: Making a whole host of QUIC framing errors pre-decryption non-fatal. If (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Add_varz_to_track_accuracy_77877600
Patch Set: Created 6 years, 2 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/quic_connection.h ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection.cc
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index fd487eb1ced2905e371bb89524918304bd41bd9e..472ee9b7f6f5a9b8a174055525d831a10b2c61e8 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -196,6 +196,7 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id,
connection_id_(connection_id),
peer_address_(address),
migrating_peer_port_(0),
+ last_packet_decrypted_(false),
last_packet_revived_(false),
last_size_(0),
last_decrypted_packet_level_(ENCRYPTION_NONE),
@@ -291,10 +292,16 @@ bool QuicConnection::SelectMutualVersion(
}
void QuicConnection::OnError(QuicFramer* framer) {
- // Packets that we cannot decrypt are dropped.
+ // Packets that we can not or have not decrypted are dropped.
// TODO(rch): add stats to measure this.
- if (!connected_ || framer->error() == QUIC_DECRYPTION_FAILURE) {
- return;
+ if (FLAGS_quic_drop_junk_packets) {
+ if (!connected_ || last_packet_decrypted_ == false) {
+ return;
+ }
+ } else {
+ if (!connected_ || framer->error() == QUIC_DECRYPTION_FAILURE) {
+ return;
+ }
}
SendConnectionCloseWithDetails(framer->error(), framer->detailed_error());
}
@@ -310,6 +317,8 @@ void QuicConnection::OnPacket() {
last_blocked_frames_.empty() &&
last_ping_frames_.empty() &&
last_close_frames_.empty());
+ last_packet_decrypted_ = false;
+ last_packet_revived_ = false;
}
void QuicConnection::OnPublicResetPacket(
@@ -435,6 +444,7 @@ bool QuicConnection::OnUnauthenticatedHeader(const QuicPacketHeader& header) {
void QuicConnection::OnDecryptedPacket(EncryptionLevel level) {
last_decrypted_packet_level_ = level;
+ last_packet_decrypted_ = true;
}
bool QuicConnection::OnPacketHeader(const QuicPacketHeader& header) {
@@ -1102,7 +1112,6 @@ void QuicConnection::ProcessUdpPacket(const IPEndPoint& self_address,
if (debug_visitor_.get() != nullptr) {
debug_visitor_->OnPacketReceived(self_address, peer_address, packet);
}
- last_packet_revived_ = false;
last_size_ = packet.length();
CheckForAddressMigration(self_address, peer_address);
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698