| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 } | 285 } |
| 286 | 286 |
| 287 // Packet's connection ID is unknown. | 287 // Packet's connection ID is unknown. |
| 288 // Apply the validity checks. | 288 // Apply the validity checks. |
| 289 QuicPacketFate fate = ValidityChecks(header); | 289 QuicPacketFate fate = ValidityChecks(header); |
| 290 switch (fate) { | 290 switch (fate) { |
| 291 case kFateProcess: { | 291 case kFateProcess: { |
| 292 // Create a session and process the packet. | 292 // Create a session and process the packet. |
| 293 QuicServerSession* session = | 293 QuicServerSession* session = |
| 294 CreateQuicSession(connection_id, current_client_address_); | 294 CreateQuicSession(connection_id, current_client_address_); |
| 295 if (FLAGS_enable_quic_stateless_reject_support) { | |
| 296 session->set_use_stateless_rejects_if_peer_supported(true); | |
| 297 } | |
| 298 DVLOG(1) << "Created new session for " << connection_id; | 295 DVLOG(1) << "Created new session for " << connection_id; |
| 299 session_map_.insert(std::make_pair(connection_id, session)); | 296 session_map_.insert(std::make_pair(connection_id, session)); |
| 300 session->connection()->ProcessUdpPacket( | 297 session->connection()->ProcessUdpPacket( |
| 301 current_server_address_, current_client_address_, *current_packet_); | 298 current_server_address_, current_client_address_, *current_packet_); |
| 302 break; | 299 break; |
| 303 } | 300 } |
| 304 case kFateTimeWait: | 301 case kFateTimeWait: |
| 305 // Add this connection_id to the time-wait state, to safely reject | 302 // Add this connection_id to the time-wait state, to safely reject |
| 306 // future packets. | 303 // future packets. |
| 307 DVLOG(1) << "Adding connection ID " << connection_id | 304 DVLOG(1) << "Adding connection ID " << connection_id |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 // send it to the time wait manager in OnUnathenticatedHeader. | 484 // send it to the time wait manager in OnUnathenticatedHeader. |
| 488 return true; | 485 return true; |
| 489 } | 486 } |
| 490 | 487 |
| 491 void QuicDispatcher::SetLastError(QuicErrorCode error) { | 488 void QuicDispatcher::SetLastError(QuicErrorCode error) { |
| 492 last_error_ = error; | 489 last_error_ = error; |
| 493 } | 490 } |
| 494 | 491 |
| 495 } // namespace tools | 492 } // namespace tools |
| 496 } // namespace net | 493 } // namespace net |
| OLD | NEW |