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

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

Issue 1138443003: Land Recent QUIC Changes until 05/13/2015 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile error fixes Created 5 years, 7 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/tools/quic/quic_time_wait_list_manager.h ('k') | net/tools/quic/quic_time_wait_list_manager_test.cc » ('j') | 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 baba81e0d973ff30c92fdc8235d0a4d08485bac0..c9405e550dd9760bc0f55ba2beea5243c577cc06 100644
--- a/net/tools/quic/quic_time_wait_list_manager.cc
+++ b/net/tools/quic/quic_time_wait_list_manager.cc
@@ -106,7 +106,11 @@ QuicTimeWaitListManager::~QuicTimeWaitListManager() {
void QuicTimeWaitListManager::AddConnectionIdToTimeWait(
QuicConnectionId connection_id,
QuicVersion version,
+ bool connection_rejected_statelessly,
QuicEncryptedPacket* close_packet) {
+ DCHECK(!connection_rejected_statelessly || !close_packet)
+ << "Connections that were rejected statelessly should not "
+ << "have a close packet. connection_id = " << connection_id;
int num_packets = 0;
ConnectionIdMap::iterator it = connection_id_map_.find(connection_id);
const bool new_connection_id = it == connection_id_map_.end();
@@ -118,10 +122,8 @@ void QuicTimeWaitListManager::AddConnectionIdToTimeWait(
TrimTimeWaitListIfNeeded();
DCHECK_LT(num_connections(),
static_cast<size_t>(FLAGS_quic_time_wait_list_max_connections));
- ConnectionIdData data(num_packets,
- version,
- clock_->ApproximateNow(),
- close_packet);
+ ConnectionIdData data(num_packets, version, clock_->ApproximateNow(),
+ close_packet, connection_rejected_statelessly);
connection_id_map_.insert(std::make_pair(connection_id, data));
if (new_connection_id) {
visitor_->OnConnectionAddedToTimeWaitList(connection_id);
@@ -164,22 +166,24 @@ void QuicTimeWaitListManager::ProcessPacket(
ConnectionIdMap::iterator it = connection_id_map_.find(connection_id);
DCHECK(it != connection_id_map_.end());
// Increment the received packet count.
- ++((it->second).num_packets);
- if (!ShouldSendResponse((it->second).num_packets)) {
+ ConnectionIdData* connection_data = &it->second;
+ ++(connection_data->num_packets);
+ if (!ShouldSendResponse(connection_data->num_packets)) {
return;
}
- if (it->second.close_packet) {
- QueuedPacket* queued_packet =
- new QueuedPacket(server_address,
- client_address,
- it->second.close_packet->Clone());
+ 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 {
+ } else if (!connection_data->connection_rejected_statelessly) {
SendPublicReset(server_address,
client_address,
connection_id,
sequence_number);
+ } else {
+ DVLOG(3) << "Time wait list not sending response for connection "
+ << connection_id << " due to previous stateless reject.";
}
}
« no previous file with comments | « net/tools/quic/quic_time_wait_list_manager.h ('k') | net/tools/quic/quic_time_wait_list_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698