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

Unified Diff: net/tools/quic/quic_time_wait_list_manager.cc

Issue 1413713005: Minor refactor of QuicTimeWaitListManager::ProcessPacket to use early returns. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@105358957
Patch Set: Created 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_time_wait_list_manager.cc
diff --git a/net/tools/quic/quic_time_wait_list_manager.cc b/net/tools/quic/quic_time_wait_list_manager.cc
index 1e433e5d577b31a0b0e44cc0e2f2bf1ad303d429..8c2b46a01f60b5f5606a9df1f44e97b0652f7318 100644
--- a/net/tools/quic/quic_time_wait_list_manager.cc
+++ b/net/tools/quic/quic_time_wait_list_manager.cc
@@ -166,21 +166,26 @@ void QuicTimeWaitListManager::ProcessPacket(
// Increment the received packet count.
ConnectionIdData* connection_data = &it->second;
++(connection_data->num_packets);
+
if (!ShouldSendResponse(connection_data->num_packets)) {
return;
}
+
if (connection_data->close_packet) {
QueuedPacket* queued_packet = new QueuedPacket(
server_address, client_address, connection_data->close_packet->Clone());
// Takes ownership of the packet.
SendOrQueuePacket(queued_packet);
- } else if (!connection_data->connection_rejected_statelessly) {
- SendPublicReset(server_address, client_address, connection_id,
- packet_number);
- } else {
+ return;
+ }
+
+ if (connection_data->connection_rejected_statelessly) {
DVLOG(3) << "Time wait list not sending response for connection "
<< connection_id << " due to previous stateless reject.";
+ return;
}
+
+ SendPublicReset(server_address, client_address, connection_id, packet_number);
}
// Returns true if the number of packets received for this connection_id is a
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698