Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Side by Side Diff: net/tools/quic/quic_dispatcher.cc

Issue 2517463002: Move kInvalidPacketNumber to QuicDispatcher: the only place it is used. No behavior change. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/core/quic_protocol.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/quic/core/quic_protocol.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698