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/debug/stack_trace.h" | 9 #include "base/debug/stack_trace.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 return HandlePacketForTimeWait(header); | 304 return HandlePacketForTimeWait(header); |
305 } | 305 } |
306 | 306 |
307 // The packet has an unknown connection ID. | 307 // The packet has an unknown connection ID. |
308 | 308 |
309 // Unless the packet provides a version, assume that we can continue | 309 // Unless the packet provides a version, assume that we can continue |
310 // processing using our preferred version. | 310 // processing using our preferred version. |
311 QuicVersion version = GetSupportedVersions().front(); | 311 QuicVersion version = GetSupportedVersions().front(); |
312 if (header.version_flag) { | 312 if (header.version_flag) { |
313 QuicVersion packet_version = header.versions.front(); | 313 QuicVersion packet_version = header.versions.front(); |
| 314 if (FLAGS_quic_fix_version_manager && |
| 315 framer_.supported_versions() != GetSupportedVersions()) { |
| 316 // Reset framer's version if version flags change in flight. |
| 317 framer_.SetSupportedVersions(GetSupportedVersions()); |
| 318 } |
314 if (!framer_.IsSupportedVersion(packet_version)) { | 319 if (!framer_.IsSupportedVersion(packet_version)) { |
315 if (ShouldCreateSessionForUnknownVersion(framer_.last_version_tag())) { | 320 if (ShouldCreateSessionForUnknownVersion(framer_.last_version_tag())) { |
316 return true; | 321 return true; |
317 } | 322 } |
318 // Since the version is not supported, send a version negotiation | 323 // Since the version is not supported, send a version negotiation |
319 // packet and stop processing the current packet. | 324 // packet and stop processing the current packet. |
320 time_wait_list_manager()->SendVersionNegotiationPacket( | 325 time_wait_list_manager()->SendVersionNegotiationPacket( |
321 connection_id, GetSupportedVersions(), current_server_address_, | 326 connection_id, GetSupportedVersions(), current_server_address_, |
322 current_client_address_); | 327 current_client_address_); |
323 return false; | 328 return false; |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 void QuicDispatcher::DeliverPacketsToSession( | 992 void QuicDispatcher::DeliverPacketsToSession( |
988 const std::list<BufferedPacket>& packets, | 993 const std::list<BufferedPacket>& packets, |
989 QuicSession* session) { | 994 QuicSession* session) { |
990 for (const BufferedPacket& packet : packets) { | 995 for (const BufferedPacket& packet : packets) { |
991 session->ProcessUdpPacket(packet.server_address, packet.client_address, | 996 session->ProcessUdpPacket(packet.server_address, packet.client_address, |
992 *(packet.packet)); | 997 *(packet.packet)); |
993 } | 998 } |
994 } | 999 } |
995 | 1000 |
996 } // namespace net | 1001 } // namespace net |
OLD | NEW |