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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 // set. Since this may be a client continuing a connection we lost track of | 422 // set. Since this may be a client continuing a connection we lost track of |
423 // via server restart, send a rejection to fast-fail the connection. | 423 // via server restart, send a rejection to fast-fail the connection. |
424 if (!header.public_header.version_flag) { | 424 if (!header.public_header.version_flag) { |
425 DVLOG(1) << "Packet without version arrived for unknown connection ID " | 425 DVLOG(1) << "Packet without version arrived for unknown connection ID " |
426 << header.public_header.connection_id; | 426 << header.public_header.connection_id; |
427 return kFateTimeWait; | 427 return kFateTimeWait; |
428 } | 428 } |
429 | 429 |
430 // Check that the sequence number is within the range that the client is | 430 // Check that the sequence number is within the range that the client is |
431 // expected to send before receiving a response from the server. | 431 // expected to send before receiving a response from the server. |
| 432 const int kInvalidPacketNumber = 0; |
432 if (header.packet_number == kInvalidPacketNumber || | 433 if (header.packet_number == kInvalidPacketNumber || |
433 header.packet_number > kMaxReasonableInitialPacketNumber) { | 434 header.packet_number > kMaxReasonableInitialPacketNumber) { |
434 return kFateTimeWait; | 435 return kFateTimeWait; |
435 } | 436 } |
436 | 437 |
437 return kFateProcess; | 438 return kFateProcess; |
438 } | 439 } |
439 | 440 |
440 void QuicDispatcher::CleanUpSession(SessionMap::iterator it, | 441 void QuicDispatcher::CleanUpSession(SessionMap::iterator it, |
441 QuicConnection* connection, | 442 QuicConnection* connection, |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 void QuicDispatcher::DeliverPacketsToSession( | 987 void QuicDispatcher::DeliverPacketsToSession( |
987 const std::list<BufferedPacket>& packets, | 988 const std::list<BufferedPacket>& packets, |
988 QuicSession* session) { | 989 QuicSession* session) { |
989 for (const BufferedPacket& packet : packets) { | 990 for (const BufferedPacket& packet : packets) { |
990 session->ProcessUdpPacket(packet.server_address, packet.client_address, | 991 session->ProcessUdpPacket(packet.server_address, packet.client_address, |
991 *(packet.packet)); | 992 *(packet.packet)); |
992 } | 993 } |
993 } | 994 } |
994 | 995 |
995 } // namespace net | 996 } // namespace net |
OLD | NEW |