| 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 } | 383 } |
| 384 } | 384 } |
| 385 | 385 |
| 386 bool QuicDispatcher::HasPendingWrites() const { | 386 bool QuicDispatcher::HasPendingWrites() const { |
| 387 return !write_blocked_list_.empty(); | 387 return !write_blocked_list_.empty(); |
| 388 } | 388 } |
| 389 | 389 |
| 390 void QuicDispatcher::Shutdown() { | 390 void QuicDispatcher::Shutdown() { |
| 391 while (!session_map_.empty()) { | 391 while (!session_map_.empty()) { |
| 392 QuicServerSession* session = session_map_.begin()->second; | 392 QuicServerSession* session = session_map_.begin()->second; |
| 393 session->connection()->SendConnectionClose(QUIC_PEER_GOING_AWAY); | 393 session->connection()->SendConnectionCloseWithDetails( |
| 394 QUIC_PEER_GOING_AWAY, "Server shutdown imminent"); |
| 394 // Validate that the session removes itself from the session map on close. | 395 // Validate that the session removes itself from the session map on close. |
| 395 DCHECK(session_map_.empty() || session_map_.begin()->second != session); | 396 DCHECK(session_map_.empty() || session_map_.begin()->second != session); |
| 396 } | 397 } |
| 397 DeleteSessions(); | 398 DeleteSessions(); |
| 398 } | 399 } |
| 399 | 400 |
| 400 void QuicDispatcher::OnConnectionClosed(QuicConnectionId connection_id, | 401 void QuicDispatcher::OnConnectionClosed(QuicConnectionId connection_id, |
| 401 QuicErrorCode error) { | 402 QuicErrorCode error) { |
| 402 SessionMap::iterator it = session_map_.find(connection_id); | 403 SessionMap::iterator it = session_map_.find(connection_id); |
| 403 if (it == session_map_.end()) { | 404 if (it == session_map_.end()) { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 // send it to the time wait manager in OnUnathenticatedHeader. | 485 // send it to the time wait manager in OnUnathenticatedHeader. |
| 485 return true; | 486 return true; |
| 486 } | 487 } |
| 487 | 488 |
| 488 void QuicDispatcher::SetLastError(QuicErrorCode error) { | 489 void QuicDispatcher::SetLastError(QuicErrorCode error) { |
| 489 last_error_ = error; | 490 last_error_ = error; |
| 490 } | 491 } |
| 491 | 492 |
| 492 } // namespace tools | 493 } // namespace tools |
| 493 } // namespace net | 494 } // namespace net |
| OLD | NEW |