| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_dispatcher.h" | 5 #include "net/tools/quic/quic_dispatcher.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 void ProcessPacket(QuicSocketAddress client_address, | 242 void ProcessPacket(QuicSocketAddress client_address, |
| 243 QuicConnectionId connection_id, | 243 QuicConnectionId connection_id, |
| 244 bool has_version_flag, | 244 bool has_version_flag, |
| 245 QuicVersion version, | 245 QuicVersion version, |
| 246 const string& data, | 246 const string& data, |
| 247 QuicConnectionIdLength connection_id_length, | 247 QuicConnectionIdLength connection_id_length, |
| 248 QuicPacketNumberLength packet_number_length, | 248 QuicPacketNumberLength packet_number_length, |
| 249 QuicPacketNumber packet_number) { | 249 QuicPacketNumber packet_number) { |
| 250 QuicVersionVector versions(SupportedVersions(version)); | 250 QuicVersionVector versions(SupportedVersions(version)); |
| 251 std::unique_ptr<QuicEncryptedPacket> packet(ConstructEncryptedPacket( | 251 std::unique_ptr<QuicEncryptedPacket> packet(ConstructEncryptedPacket( |
| 252 connection_id, has_version_flag, false, packet_number, data, | 252 GetPeerInMemoryConnectionId(connection_id), has_version_flag, false, |
| 253 connection_id_length, packet_number_length, &versions)); | 253 packet_number, data, connection_id_length, packet_number_length, |
| 254 &versions)); |
| 254 std::unique_ptr<QuicReceivedPacket> received_packet( | 255 std::unique_ptr<QuicReceivedPacket> received_packet( |
| 255 ConstructReceivedPacket(*packet, helper_.GetClock()->Now())); | 256 ConstructReceivedPacket(*packet, helper_.GetClock()->Now())); |
| 256 | 257 |
| 257 if (ChloExtractor::Extract(*packet, versions, nullptr)) { | 258 if (ChloExtractor::Extract(*packet, versions, nullptr)) { |
| 258 // Add CHLO packet to the beginning to be verified first, because it is | 259 // Add CHLO packet to the beginning to be verified first, because it is |
| 259 // also processed first by new session. | 260 // also processed first by new session. |
| 260 data_connection_map_[connection_id].push_front( | 261 data_connection_map_[connection_id].push_front( |
| 261 string(packet->data(), packet->length())); | 262 string(packet->data(), packet->length())); |
| 262 } else { | 263 } else { |
| 263 // For non-CHLO, always append to last. | 264 // For non-CHLO, always append to last. |
| (...skipping 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2093 check.Call(2); | 2094 check.Call(2); |
| 2094 GetFakeProofSource()->InvokePendingCallback(0); | 2095 GetFakeProofSource()->InvokePendingCallback(0); |
| 2095 ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 0); | 2096 ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 0); |
| 2096 EXPECT_FALSE(store->HasBufferedPackets(conn_id)); | 2097 EXPECT_FALSE(store->HasBufferedPackets(conn_id)); |
| 2097 EXPECT_FALSE(time_wait_list_manager_->IsConnectionIdInTimeWait(conn_id)); | 2098 EXPECT_FALSE(time_wait_list_manager_->IsConnectionIdInTimeWait(conn_id)); |
| 2098 } | 2099 } |
| 2099 | 2100 |
| 2100 } // namespace | 2101 } // namespace |
| 2101 } // namespace test | 2102 } // namespace test |
| 2102 } // namespace net | 2103 } // namespace net |
| OLD | NEW |