| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 const std::tr1::tuple<const char*, int> packet_buffer, | 152 const std::tr1::tuple<const char*, int> packet_buffer, |
| 153 testing::MatchResultListener* /* listener */) const override { | 153 testing::MatchResultListener* /* listener */) const override { |
| 154 FramerVisitorCapturingPublicReset visitor; | 154 FramerVisitorCapturingPublicReset visitor; |
| 155 QuicFramer framer(AllSupportedVersions(), QuicTime::Zero(), | 155 QuicFramer framer(AllSupportedVersions(), QuicTime::Zero(), |
| 156 Perspective::IS_CLIENT); | 156 Perspective::IS_CLIENT); |
| 157 framer.set_visitor(&visitor); | 157 framer.set_visitor(&visitor); |
| 158 QuicEncryptedPacket encrypted(std::tr1::get<0>(packet_buffer), | 158 QuicEncryptedPacket encrypted(std::tr1::get<0>(packet_buffer), |
| 159 std::tr1::get<1>(packet_buffer)); | 159 std::tr1::get<1>(packet_buffer)); |
| 160 framer.ProcessPacket(encrypted); | 160 framer.ProcessPacket(encrypted); |
| 161 QuicPublicResetPacket packet = visitor.public_reset_packet(); | 161 QuicPublicResetPacket packet = visitor.public_reset_packet(); |
| 162 return connection_id_ == packet.public_header.connection_id && | 162 return connection_id_ == GetPeerInMemoryConnectionId( |
| 163 packet.public_header.connection_id) && |
| 163 packet.public_header.reset_flag && | 164 packet.public_header.reset_flag && |
| 164 !packet.public_header.version_flag && | 165 !packet.public_header.version_flag && |
| 165 packet_number_ == packet.rejected_packet_number && | 166 packet_number_ == packet.rejected_packet_number && |
| 166 net::test::TestPeerIPAddress() == packet.client_address.host() && | 167 net::test::TestPeerIPAddress() == packet.client_address.host() && |
| 167 kTestPort == packet.client_address.port(); | 168 kTestPort == packet.client_address.port(); |
| 168 } | 169 } |
| 169 | 170 |
| 170 void DescribeTo(::std::ostream* os) const override {} | 171 void DescribeTo(::std::ostream* os) const override {} |
| 171 | 172 |
| 172 void DescribeNegationTo(::std::ostream* os) const override {} | 173 void DescribeNegationTo(::std::ostream* os) const override {} |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 EXPECT_EQ(static_cast<size_t>(FLAGS_quic_time_wait_list_max_connections), | 523 EXPECT_EQ(static_cast<size_t>(FLAGS_quic_time_wait_list_max_connections), |
| 523 time_wait_list_manager_.num_connections()); | 524 time_wait_list_manager_.num_connections()); |
| 524 EXPECT_FALSE(IsConnectionIdInTimeWait(id_to_evict)); | 525 EXPECT_FALSE(IsConnectionIdInTimeWait(id_to_evict)); |
| 525 EXPECT_TRUE(IsConnectionIdInTimeWait(current_connection_id)); | 526 EXPECT_TRUE(IsConnectionIdInTimeWait(current_connection_id)); |
| 526 } | 527 } |
| 527 } | 528 } |
| 528 | 529 |
| 529 } // namespace | 530 } // namespace |
| 530 } // namespace test | 531 } // namespace test |
| 531 } // namespace net | 532 } // namespace net |
| OLD | NEW |