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

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

Issue 1541263002: Landing Recent QUIC changes until 12/18/2015 13:57 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: replace -1 with 0xff for InvalidPathId 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_bin.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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 } 381 }
382 } 382 }
383 383
384 bool QuicDispatcher::HasPendingWrites() const { 384 bool QuicDispatcher::HasPendingWrites() const {
385 return !write_blocked_list_.empty(); 385 return !write_blocked_list_.empty();
386 } 386 }
387 387
388 void QuicDispatcher::Shutdown() { 388 void QuicDispatcher::Shutdown() {
389 while (!session_map_.empty()) { 389 while (!session_map_.empty()) {
390 QuicServerSession* session = session_map_.begin()->second; 390 QuicServerSession* session = session_map_.begin()->second;
391 session->connection()->SendConnectionClose(QUIC_PEER_GOING_AWAY); 391 session->connection()->SendConnectionCloseWithDetails(
392 QUIC_PEER_GOING_AWAY, "Server shutdown imminent");
392 // Validate that the session removes itself from the session map on close. 393 // Validate that the session removes itself from the session map on close.
393 DCHECK(session_map_.empty() || session_map_.begin()->second != session); 394 DCHECK(session_map_.empty() || session_map_.begin()->second != session);
394 } 395 }
395 DeleteSessions(); 396 DeleteSessions();
396 } 397 }
397 398
398 void QuicDispatcher::OnConnectionClosed(QuicConnectionId connection_id, 399 void QuicDispatcher::OnConnectionClosed(QuicConnectionId connection_id,
399 QuicErrorCode error) { 400 QuicErrorCode error) {
400 SessionMap::iterator it = session_map_.find(connection_id); 401 SessionMap::iterator it = session_map_.find(connection_id);
401 if (it == session_map_.end()) { 402 if (it == session_map_.end()) {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 // send it to the time wait manager in OnUnathenticatedHeader. 482 // send it to the time wait manager in OnUnathenticatedHeader.
482 return true; 483 return true;
483 } 484 }
484 485
485 void QuicDispatcher::SetLastError(QuicErrorCode error) { 486 void QuicDispatcher::SetLastError(QuicErrorCode error) {
486 last_error_ = error; 487 last_error_ = error;
487 } 488 }
488 489
489 } // namespace tools 490 } // namespace tools
490 } // namespace net 491 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_client_bin.cc ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698