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" |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "net/quic/quic_flags.h" | 12 #include "net/quic/quic_flags.h" |
13 #include "net/quic/quic_utils.h" | 13 #include "net/quic/quic_utils.h" |
14 #include "net/tools/quic/quic_per_connection_packet_writer.h" | 14 #include "net/tools/quic/quic_per_connection_packet_writer.h" |
15 #include "net/tools/quic/quic_time_wait_list_manager.h" | 15 #include "net/tools/quic/quic_time_wait_list_manager.h" |
16 | 16 |
17 namespace net { | 17 namespace net { |
18 | 18 |
| 19 class SocketPerformanceWatcher; |
| 20 |
19 namespace tools { | 21 namespace tools { |
20 | 22 |
21 using std::make_pair; | 23 using std::make_pair; |
22 using base::StringPiece; | 24 using base::StringPiece; |
23 | 25 |
24 // The threshold size for the session map, over which the dispatcher will start | 26 // The threshold size for the session map, over which the dispatcher will start |
25 // sending stateless rejects (SREJ), rather than stateful rejects (REJ) to | 27 // sending stateless rejects (SREJ), rather than stateful rejects (REJ) to |
26 // clients who support them. If -1, stateless rejects will not be sent. If 0, | 28 // clients who support them. If -1, stateless rejects will not be sent. If 0, |
27 // the server will only send stateless rejects to clients who support them. | 29 // the server will only send stateless rejects to clients who support them. |
28 int32 FLAGS_quic_session_map_threshold_for_stateless_rejects = -1; | 30 int32 FLAGS_quic_session_map_threshold_for_stateless_rejects = -1; |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 } | 463 } |
462 | 464 |
463 QuicServerSession* QuicDispatcher::CreateQuicSession( | 465 QuicServerSession* QuicDispatcher::CreateQuicSession( |
464 QuicConnectionId connection_id, | 466 QuicConnectionId connection_id, |
465 const IPEndPoint& server_address, | 467 const IPEndPoint& server_address, |
466 const IPEndPoint& client_address) { | 468 const IPEndPoint& client_address) { |
467 // The QuicServerSession takes ownership of |connection| below. | 469 // The QuicServerSession takes ownership of |connection| below. |
468 QuicConnection* connection = new QuicConnection( | 470 QuicConnection* connection = new QuicConnection( |
469 connection_id, client_address, helper_.get(), connection_writer_factory_, | 471 connection_id, client_address, helper_.get(), connection_writer_factory_, |
470 /* owns_writer= */ true, Perspective::IS_SERVER, | 472 /* owns_writer= */ true, Perspective::IS_SERVER, |
471 crypto_config_->HasProofSource(), supported_versions_); | 473 crypto_config_->HasProofSource(), supported_versions_, |
| 474 scoped_ptr<SocketPerformanceWatcher>()); |
472 | 475 |
473 QuicServerSession* session = | 476 QuicServerSession* session = |
474 new QuicServerSession(config_, connection, this, crypto_config_); | 477 new QuicServerSession(config_, connection, this, crypto_config_); |
475 session->Initialize(); | 478 session->Initialize(); |
476 if (FLAGS_quic_session_map_threshold_for_stateless_rejects != -1 && | 479 if (FLAGS_quic_session_map_threshold_for_stateless_rejects != -1 && |
477 session_map_.size() >= | 480 session_map_.size() >= |
478 static_cast<size_t>( | 481 static_cast<size_t>( |
479 FLAGS_quic_session_map_threshold_for_stateless_rejects)) { | 482 FLAGS_quic_session_map_threshold_for_stateless_rejects)) { |
480 session->set_use_stateless_rejects_if_peer_supported(true); | 483 session->set_use_stateless_rejects_if_peer_supported(true); |
481 } | 484 } |
(...skipping 25 matching lines...) Expand all Loading... |
507 // send it to the time wait manager in OnUnathenticatedHeader. | 510 // send it to the time wait manager in OnUnathenticatedHeader. |
508 return true; | 511 return true; |
509 } | 512 } |
510 | 513 |
511 void QuicDispatcher::SetLastError(QuicErrorCode error) { | 514 void QuicDispatcher::SetLastError(QuicErrorCode error) { |
512 last_error_ = error; | 515 last_error_ = error; |
513 } | 516 } |
514 | 517 |
515 } // namespace tools | 518 } // namespace tools |
516 } // namespace net | 519 } // namespace net |
OLD | NEW |