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

Unified Diff: net/quic/quic_connection.cc

Issue 421913015: Add methods to the QuicConnectionDebug visitor for tracking various (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@change_OnStreamFrame_to_return_void_71870242
Patch Set: Created 6 years, 5 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') | no next file » | 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 4a99c2fea287995f69f311535a18601ce524f64b..6e6d05f50f9699054e3eae7513530eeb809f11f8 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -443,6 +443,10 @@ bool QuicConnection::OnPacketHeader(const QuicPacketHeader& header) {
DVLOG(1) << ENDPOINT << "Ignoring packet from unexpected ConnectionId: "
<< header.public_header.connection_id << " instead of "
<< connection_id_;
+ if (debug_visitor_.get() != NULL) {
+ debug_visitor_->OnIncorrectConnectionId(
+ header.public_header.connection_id);
+ }
return false;
}
@@ -461,8 +465,9 @@ bool QuicConnection::OnPacketHeader(const QuicPacketHeader& header) {
header.packet_sequence_number)) {
DVLOG(1) << ENDPOINT << "Packet " << header.packet_sequence_number
<< " no longer being waited for. Discarding.";
- // TODO(jri): Log reception of duplicate packets or packets the peer has
- // told us to stop waiting for.
+ if (debug_visitor_.get() != NULL) {
+ debug_visitor_->OnDuplicatePacket(header.packet_sequence_number);
+ }
return false;
}
@@ -1087,10 +1092,13 @@ void QuicConnection::ProcessUdpPacket(const IPEndPoint& self_address,
if (!framer_.ProcessPacket(packet)) {
// If we are unable to decrypt this packet, it might be
// because the CHLO or SHLO packet was lost.
- if (encryption_level_ != ENCRYPTION_FORWARD_SECURE &&
- framer_.error() == QUIC_DECRYPTION_FAILURE &&
- undecryptable_packets_.size() < kMaxUndecryptablePackets) {
- QueueUndecryptablePacket(packet);
+ if (framer_.error() == QUIC_DECRYPTION_FAILURE) {
+ if (encryption_level_ != ENCRYPTION_FORWARD_SECURE &&
+ undecryptable_packets_.size() < kMaxUndecryptablePackets) {
+ QueueUndecryptablePacket(packet);
+ } else if (debug_visitor_ != NULL) {
+ debug_visitor_->OnUndecryptablePacket();
+ }
}
DVLOG(1) << ENDPOINT << "Unable to process packet. Last packet processed: "
<< last_header_.packet_sequence_number;
@@ -1687,6 +1695,11 @@ void QuicConnection::MaybeProcessUndecryptablePackets() {
// new keys installed and hence any undecryptable packets will
// never be able to be decrypted.
if (encryption_level_ == ENCRYPTION_FORWARD_SECURE) {
+ if (debug_visitor_ != NULL) {
+ for (size_t i = 0; i < undecryptable_packets_.size(); ++i) {
+ debug_visitor_->OnUndecryptablePacket();
+ }
+ }
STLDeleteElements(&undecryptable_packets_);
}
}
« no previous file with comments | « net/quic/quic_connection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698