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

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

Issue 1548783002: Adding details to most quic connection close calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@110540464
Patch Set: Created 4 years, 12 months 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/tools/quic/quic_client.cc ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « net/tools/quic/quic_client.cc ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698