| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "net/quic/core/crypto/quic_random.h" | 10 #include "net/quic/core/crypto/quic_random.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 return HandlePacketForTimeWait(header); | 300 return HandlePacketForTimeWait(header); |
| 301 } | 301 } |
| 302 | 302 |
| 303 // The packet has an unknown connection ID. | 303 // The packet has an unknown connection ID. |
| 304 | 304 |
| 305 // Unless the packet provides a version, assume that we can continue | 305 // Unless the packet provides a version, assume that we can continue |
| 306 // processing using our preferred version. | 306 // processing using our preferred version. |
| 307 QuicVersion version = GetSupportedVersions().front(); | 307 QuicVersion version = GetSupportedVersions().front(); |
| 308 if (header.version_flag) { | 308 if (header.version_flag) { |
| 309 QuicVersion packet_version = header.versions.front(); | 309 QuicVersion packet_version = header.versions.front(); |
| 310 if (FLAGS_quic_reloadable_flag_quic_fix_version_manager && | 310 if (framer_.supported_versions() != GetSupportedVersions()) { |
| 311 framer_.supported_versions() != GetSupportedVersions()) { | |
| 312 // Reset framer's version if version flags change in flight. | 311 // Reset framer's version if version flags change in flight. |
| 313 framer_.SetSupportedVersions(GetSupportedVersions()); | 312 framer_.SetSupportedVersions(GetSupportedVersions()); |
| 314 } | 313 } |
| 315 if (!framer_.IsSupportedVersion(packet_version)) { | 314 if (!framer_.IsSupportedVersion(packet_version)) { |
| 316 if (ShouldCreateSessionForUnknownVersion(framer_.last_version_tag())) { | 315 if (ShouldCreateSessionForUnknownVersion(framer_.last_version_tag())) { |
| 317 return true; | 316 return true; |
| 318 } | 317 } |
| 319 // Since the version is not supported, send a version negotiation | 318 // Since the version is not supported, send a version negotiation |
| 320 // packet and stop processing the current packet. | 319 // packet and stop processing the current packet. |
| 321 time_wait_list_manager()->SendVersionNegotiationPacket( | 320 time_wait_list_manager()->SendVersionNegotiationPacket( |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 void QuicDispatcher::DeliverPacketsToSession( | 985 void QuicDispatcher::DeliverPacketsToSession( |
| 987 const std::list<BufferedPacket>& packets, | 986 const std::list<BufferedPacket>& packets, |
| 988 QuicSession* session) { | 987 QuicSession* session) { |
| 989 for (const BufferedPacket& packet : packets) { | 988 for (const BufferedPacket& packet : packets) { |
| 990 session->ProcessUdpPacket(packet.server_address, packet.client_address, | 989 session->ProcessUdpPacket(packet.server_address, packet.client_address, |
| 991 *(packet.packet)); | 990 *(packet.packet)); |
| 992 } | 991 } |
| 993 } | 992 } |
| 994 | 993 |
| 995 } // namespace net | 994 } // namespace net |
| OLD | NEW |