| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/quic/quic_dispatcher.h" | 5 #include "net/quic/quic_dispatcher.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 } | 370 } |
| 371 | 371 |
| 372 QuicConnection* QuicDispatcher::CreateQuicConnection( | 372 QuicConnection* QuicDispatcher::CreateQuicConnection( |
| 373 QuicConnectionId connection_id, | 373 QuicConnectionId connection_id, |
| 374 const IPEndPoint& server_address, | 374 const IPEndPoint& server_address, |
| 375 const IPEndPoint& client_address, | 375 const IPEndPoint& client_address, |
| 376 QuicPerConnectionPacketWriter* writer) { | 376 QuicPerConnectionPacketWriter* writer) { |
| 377 QuicConnection* connection; | 377 QuicConnection* connection; |
| 378 if (FLAGS_enable_quic_connection_flow_control_2) { | 378 if (FLAGS_enable_quic_connection_flow_control_2) { |
| 379 DVLOG(1) << "Creating QuicDispatcher with all versions."; | 379 DVLOG(1) << "Creating QuicDispatcher with all versions."; |
| 380 connection = new QuicConnection(connection_id, client_address, helper_, | 380 connection = new QuicConnection(connection_id, |
| 381 writer, true, supported_versions_); | 381 client_address, |
| 382 helper_, |
| 383 writer, |
| 384 false /* owns_writer */, |
| 385 true /* is_server */, |
| 386 supported_versions_); |
| 382 } else { | 387 } else { |
| 383 DVLOG(1) << "Connection flow control disabled, creating QuicDispatcher " | 388 DVLOG(1) << "Connection flow control disabled, creating QuicDispatcher " |
| 384 << "WITHOUT version 19 or higher."; | 389 << "WITHOUT version 19 or higher."; |
| 385 connection = new QuicConnection( | 390 connection = new QuicConnection( |
| 386 connection_id, client_address, helper_, writer, true, | 391 connection_id, |
| 392 client_address, |
| 393 helper_, |
| 394 writer, |
| 395 false /* owns_writer */, |
| 396 true /* is_server */, |
| 387 supported_versions_no_connection_flow_control_); | 397 supported_versions_no_connection_flow_control_); |
| 388 } | 398 } |
| 389 writer->set_connection(connection); | 399 writer->set_connection(connection); |
| 390 return connection; | 400 return connection; |
| 391 } | 401 } |
| 392 | 402 |
| 393 QuicTimeWaitListManager* QuicDispatcher::CreateQuicTimeWaitListManager() { | 403 QuicTimeWaitListManager* QuicDispatcher::CreateQuicTimeWaitListManager() { |
| 394 return new QuicTimeWaitListManager( | 404 return new QuicTimeWaitListManager( |
| 395 writer_.get(), this, helper_, supported_versions()); | 405 writer_.get(), this, helper_, supported_versions()); |
| 396 } | 406 } |
| 397 | 407 |
| 398 bool QuicDispatcher::HandlePacketForTimeWait( | 408 bool QuicDispatcher::HandlePacketForTimeWait( |
| 399 const QuicPacketPublicHeader& header) { | 409 const QuicPacketPublicHeader& header) { |
| 400 if (header.reset_flag) { | 410 if (header.reset_flag) { |
| 401 // Public reset packets do not have sequence numbers, so ignore the packet. | 411 // Public reset packets do not have sequence numbers, so ignore the packet. |
| 402 return false; | 412 return false; |
| 403 } | 413 } |
| 404 | 414 |
| 405 // Switch the framer to the correct version, so that the sequence number can | 415 // Switch the framer to the correct version, so that the sequence number can |
| 406 // be parsed correctly. | 416 // be parsed correctly. |
| 407 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId( | 417 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId( |
| 408 header.connection_id)); | 418 header.connection_id)); |
| 409 | 419 |
| 410 // Continue parsing the packet to extract the sequence number. Then | 420 // Continue parsing the packet to extract the sequence number. Then |
| 411 // send it to the time wait manager in OnUnathenticatedHeader. | 421 // send it to the time wait manager in OnUnathenticatedHeader. |
| 412 return true; | 422 return true; |
| 413 } | 423 } |
| 414 | 424 |
| 415 } // namespace net | 425 } // namespace net |
| OLD | NEW |