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/macros.h" | 11 #include "base/macros.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "net/quic/quic_bug_tracker.h" |
13 #include "net/quic/quic_flags.h" | 14 #include "net/quic/quic_flags.h" |
14 #include "net/quic/quic_utils.h" | 15 #include "net/quic/quic_utils.h" |
15 #include "net/tools/quic/quic_per_connection_packet_writer.h" | 16 #include "net/tools/quic/quic_per_connection_packet_writer.h" |
16 #include "net/tools/quic/quic_simple_server_session.h" | 17 #include "net/tools/quic/quic_simple_server_session.h" |
17 #include "net/tools/quic/quic_time_wait_list_manager.h" | 18 #include "net/tools/quic/quic_time_wait_list_manager.h" |
18 | 19 |
19 namespace net { | 20 namespace net { |
20 | 21 |
21 namespace tools { | 22 namespace tools { |
22 | 23 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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()) { |
404 LOG(DFATAL) << "ConnectionId " << connection_id | 405 QUIC_BUG << "ConnectionId " << connection_id |
405 << " does not exist in the session map. " | 406 << " does not exist in the session map. Error: " |
406 << "Error: " << QuicUtils::ErrorToString(error); | 407 << QuicUtils::ErrorToString(error); |
407 LOG(DFATAL) << base::debug::StackTrace().ToString(); | 408 QUIC_BUG << base::debug::StackTrace().ToString();; |
408 return; | 409 return; |
409 } | 410 } |
410 | 411 |
411 DVLOG_IF(1, error != QUIC_NO_ERROR) | 412 DVLOG_IF(1, error != QUIC_NO_ERROR) |
412 << "Closing connection (" << connection_id | 413 << "Closing connection (" << connection_id |
413 << ") due to error: " << QuicUtils::ErrorToString(error); | 414 << ") due to error: " << QuicUtils::ErrorToString(error); |
414 | 415 |
415 if (closed_session_list_.empty()) { | 416 if (closed_session_list_.empty()) { |
416 delete_sessions_alarm_->Cancel(); | 417 delete_sessions_alarm_->Cancel(); |
417 delete_sessions_alarm_->Set(helper()->GetClock()->ApproximateNow()); | 418 delete_sessions_alarm_->Set(helper()->GetClock()->ApproximateNow()); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 // send it to the time wait manager in OnUnathenticatedHeader. | 484 // send it to the time wait manager in OnUnathenticatedHeader. |
484 return true; | 485 return true; |
485 } | 486 } |
486 | 487 |
487 void QuicDispatcher::SetLastError(QuicErrorCode error) { | 488 void QuicDispatcher::SetLastError(QuicErrorCode error) { |
488 last_error_ = error; | 489 last_error_ = error; |
489 } | 490 } |
490 | 491 |
491 } // namespace tools | 492 } // namespace tools |
492 } // namespace net | 493 } // namespace net |
OLD | NEW |