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

Unified Diff: net/quic/quic_connection.cc

Issue 1546633002: Drop not awaited packets before decrypt them. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@110393215
Patch Set: Created 5 years 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 | « no previous file | 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 e070ef63fa2b54b9664c1a33a24372efd38172b4..c9707516f32cb8400aac4bbd26e223a02b799aeb 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -623,7 +623,8 @@ bool QuicConnection::OnUnauthenticatedHeader(const QuicPacketHeader& header) {
// If this packet has already been seen, or the sender has told us that it
// will not be retransmitted, then stop processing the packet.
- if (!received_packet_manager_.IsAwaitingPacket(header.packet_number)) {
+ if (FLAGS_quic_drop_non_awaited_packets &&
+ !received_packet_manager_.IsAwaitingPacket(header.packet_number)) {
DVLOG(1) << ENDPOINT << "Packet " << header.packet_number
<< " no longer being waited for. Discarding.";
if (debug_visitor_ != nullptr) {
@@ -1983,7 +1984,15 @@ void QuicConnection::MaybeProcessRevivedPacket() {
QuicFecGroup* QuicConnection::GetFecGroup() {
QuicFecGroupNumber fec_group_num = last_header_.fec_group;
- if (fec_group_num == 0) {
+ if (fec_group_num == 0 ||
+ (FLAGS_quic_drop_non_awaited_packets &&
+ fec_group_num <
+ received_packet_manager_.peer_least_packet_awaiting_ack() &&
+ !ContainsKey(group_map_, fec_group_num))) {
+ // If the group number is below peer_least_packet_awaiting_ack and this
+ // group does not exist, which means this group has missing packets below
+ // |peer_least_packet_awaiting_ack| which we would never receive, so return
+ // nullptr.
return nullptr;
}
if (!ContainsKey(group_map_, fec_group_num)) {
@@ -2078,9 +2087,9 @@ void QuicConnection::SendGoAway(QuicErrorCode error,
void QuicConnection::CloseFecGroupsBefore(QuicPacketNumber packet_number) {
FecGroupMap::iterator it = group_map_.begin();
while (it != group_map_.end()) {
- // If this is the current group or the group doesn't protect this packet
- // we can ignore it.
- if (last_header_.fec_group == it->first ||
+ // If the group doesn't protect this packet we can ignore it.
+ if ((!FLAGS_quic_drop_non_awaited_packets &&
+ last_header_.fec_group == it->first) ||
!it->second->IsWaitingForPacketBefore(packet_number)) {
++it;
continue;
« no previous file with comments | « no previous file | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698