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

Unified Diff: net/quic/quic_connection.cc

Issue 1779313002: Temporarily store the raw QUIC packet in QuicConnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116152506
Patch Set: Created 4 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
« 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 b107ee44ba1eaf514f70a288eefa3dc5bb86bde5..c49535589465045af279a804a296b483409bab42 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -244,6 +244,7 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id,
migrating_peer_port_(0),
last_packet_decrypted_(false),
last_size_(0),
+ current_packet_data_(nullptr),
last_decrypted_packet_level_(ENCRYPTION_NONE),
should_last_packet_instigate_acks_(false),
largest_seen_packet_with_ack_(0),
@@ -1213,6 +1214,7 @@ void QuicConnection::ProcessUdpPacket(const IPEndPoint& self_address,
debug_visitor_->OnPacketReceived(self_address, peer_address, packet);
}
last_size_ = packet.length();
+ current_packet_data_ = packet.data();
if (FLAGS_check_peer_address_change_after_decryption) {
last_packet_destination_address_ = self_address;
@@ -1244,6 +1246,7 @@ void QuicConnection::ProcessUdpPacket(const IPEndPoint& self_address,
}
DVLOG(1) << ENDPOINT << "Unable to process packet. Last packet processed: "
<< last_header_.packet_number;
+ current_packet_data_ = nullptr;
return;
}
@@ -1251,6 +1254,7 @@ void QuicConnection::ProcessUdpPacket(const IPEndPoint& self_address,
MaybeProcessUndecryptablePackets();
MaybeSendInResponseToPacket();
SetPingAlarm();
+ current_packet_data_ = nullptr;
}
void QuicConnection::CheckForAddressMigration(const IPEndPoint& self_address,
@@ -2340,4 +2344,11 @@ bool QuicConnection::ack_frame_updated() const {
return received_packet_manager_.ack_frame_updated();
}
+StringPiece QuicConnection::GetCurrentPacket() {
+ if (current_packet_data_ == nullptr) {
+ return StringPiece();
+ }
+ return StringPiece(current_packet_data_, last_size_);
+}
+
} // namespace net
« 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