OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/tools/quic/quic_time_wait_list_manager.h" | 5 #include "net/tools/quic/quic_time_wait_list_manager.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <memory> | 8 #include <memory> |
9 #include <ostream> | 9 #include <ostream> |
10 | 10 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 std::vector<std::unique_ptr<QuicEncryptedPacket>>* packets) { | 108 std::vector<std::unique_ptr<QuicEncryptedPacket>>* packets) { |
109 time_wait_list_manager_.AddConnectionIdToTimeWait( | 109 time_wait_list_manager_.AddConnectionIdToTimeWait( |
110 connection_id, version, connection_rejected_statelessly, packets); | 110 connection_id, version, connection_rejected_statelessly, packets); |
111 } | 111 } |
112 | 112 |
113 bool IsConnectionIdInTimeWait(QuicConnectionId connection_id) { | 113 bool IsConnectionIdInTimeWait(QuicConnectionId connection_id) { |
114 return time_wait_list_manager_.IsConnectionIdInTimeWait(connection_id); | 114 return time_wait_list_manager_.IsConnectionIdInTimeWait(connection_id); |
115 } | 115 } |
116 | 116 |
117 void ProcessPacket(QuicConnectionId connection_id) { | 117 void ProcessPacket(QuicConnectionId connection_id) { |
118 QuicEncryptedPacket packet(nullptr, 0); | |
119 time_wait_list_manager_.ProcessPacket(server_address_, client_address_, | 118 time_wait_list_manager_.ProcessPacket(server_address_, client_address_, |
120 connection_id, packet); | 119 connection_id); |
121 } | 120 } |
122 | 121 |
123 QuicEncryptedPacket* ConstructEncryptedPacket( | 122 QuicEncryptedPacket* ConstructEncryptedPacket( |
124 QuicConnectionId connection_id, | 123 QuicConnectionId connection_id, |
125 QuicPacketNumber packet_number) { | 124 QuicPacketNumber packet_number) { |
126 return net::test::ConstructEncryptedPacket(connection_id, false, false, | 125 return net::test::ConstructEncryptedPacket(connection_id, false, false, |
127 packet_number, "data"); | 126 packet_number, "data"); |
128 } | 127 } |
129 | 128 |
130 QuicFlagSaver flags_; // Save/restore all QUIC flag values. | 129 QuicFlagSaver flags_; // Save/restore all QUIC flag values. |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 EXPECT_EQ(static_cast<size_t>(FLAGS_quic_time_wait_list_max_connections), | 511 EXPECT_EQ(static_cast<size_t>(FLAGS_quic_time_wait_list_max_connections), |
513 time_wait_list_manager_.num_connections()); | 512 time_wait_list_manager_.num_connections()); |
514 EXPECT_FALSE(IsConnectionIdInTimeWait(id_to_evict)); | 513 EXPECT_FALSE(IsConnectionIdInTimeWait(id_to_evict)); |
515 EXPECT_TRUE(IsConnectionIdInTimeWait(current_connection_id)); | 514 EXPECT_TRUE(IsConnectionIdInTimeWait(current_connection_id)); |
516 } | 515 } |
517 } | 516 } |
518 | 517 |
519 } // namespace | 518 } // namespace |
520 } // namespace test | 519 } // namespace test |
521 } // namespace net | 520 } // namespace net |
OLD | NEW |