| 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 DeleteSessions(); | 486 DeleteSessions(); |
| 487 } | 487 } |
| 488 | 488 |
| 489 void QuicDispatcher::OnConnectionClosed(QuicConnectionId connection_id, | 489 void QuicDispatcher::OnConnectionClosed(QuicConnectionId connection_id, |
| 490 QuicErrorCode error, | 490 QuicErrorCode error, |
| 491 const string& error_details) { | 491 const string& error_details) { |
| 492 SessionMap::iterator it = session_map_.find(connection_id); | 492 SessionMap::iterator it = session_map_.find(connection_id); |
| 493 if (it == session_map_.end()) { | 493 if (it == session_map_.end()) { |
| 494 QUIC_BUG << "ConnectionId " << connection_id | 494 QUIC_BUG << "ConnectionId " << connection_id |
| 495 << " does not exist in the session map. Error: " | 495 << " does not exist in the session map. Error: " |
| 496 << QuicUtils::ErrorToString(error); | 496 << QuicErrorCodeToString(error); |
| 497 QUIC_BUG << base::debug::StackTrace().ToString(); | 497 QUIC_BUG << base::debug::StackTrace().ToString(); |
| 498 return; | 498 return; |
| 499 } | 499 } |
| 500 | 500 |
| 501 DVLOG_IF(1, error != QUIC_NO_ERROR) | 501 DVLOG_IF(1, error != QUIC_NO_ERROR) |
| 502 << "Closing connection (" << connection_id | 502 << "Closing connection (" << connection_id |
| 503 << ") due to error: " << QuicUtils::ErrorToString(error) | 503 << ") due to error: " << QuicErrorCodeToString(error) |
| 504 << ", with details: " << error_details; | 504 << ", with details: " << error_details; |
| 505 | 505 |
| 506 if (closed_session_list_.empty()) { | 506 if (closed_session_list_.empty()) { |
| 507 delete_sessions_alarm_->Update(helper()->GetClock()->ApproximateNow(), | 507 delete_sessions_alarm_->Update(helper()->GetClock()->ApproximateNow(), |
| 508 QuicTime::Delta::Zero()); | 508 QuicTime::Delta::Zero()); |
| 509 } | 509 } |
| 510 QuicConnection* connection = it->second->connection(); | 510 QuicConnection* connection = it->second->connection(); |
| 511 closed_session_list_.push_back(std::move(it->second)); | 511 closed_session_list_.push_back(std::move(it->second)); |
| 512 const bool should_close_statelessly = | 512 const bool should_close_statelessly = |
| 513 (error == QUIC_CRYPTO_HANDSHAKE_STATELESS_REJECT); | 513 (error == QUIC_CRYPTO_HANDSHAKE_STATELESS_REJECT); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 529 void QuicDispatcher::OnConnectionAddedToTimeWaitList( | 529 void QuicDispatcher::OnConnectionAddedToTimeWaitList( |
| 530 QuicConnectionId connection_id) { | 530 QuicConnectionId connection_id) { |
| 531 DVLOG(1) << "Connection " << connection_id << " added to time wait list."; | 531 DVLOG(1) << "Connection " << connection_id << " added to time wait list."; |
| 532 } | 532 } |
| 533 | 533 |
| 534 void QuicDispatcher::OnPacket() {} | 534 void QuicDispatcher::OnPacket() {} |
| 535 | 535 |
| 536 void QuicDispatcher::OnError(QuicFramer* framer) { | 536 void QuicDispatcher::OnError(QuicFramer* framer) { |
| 537 QuicErrorCode error = framer->error(); | 537 QuicErrorCode error = framer->error(); |
| 538 SetLastError(error); | 538 SetLastError(error); |
| 539 DVLOG(1) << QuicUtils::ErrorToString(error); | 539 DVLOG(1) << QuicErrorCodeToString(error); |
| 540 } | 540 } |
| 541 | 541 |
| 542 bool QuicDispatcher::ShouldCreateSessionForUnknownVersion(QuicTag version_tag) { | 542 bool QuicDispatcher::ShouldCreateSessionForUnknownVersion(QuicTag version_tag) { |
| 543 return false; | 543 return false; |
| 544 } | 544 } |
| 545 | 545 |
| 546 bool QuicDispatcher::OnProtocolVersionMismatch( | 546 bool QuicDispatcher::OnProtocolVersionMismatch( |
| 547 QuicVersion /*received_version*/) { | 547 QuicVersion /*received_version*/) { |
| 548 QUIC_BUG_IF(!time_wait_list_manager_->IsConnectionIdInTimeWait( | 548 QUIC_BUG_IF(!time_wait_list_manager_->IsConnectionIdInTimeWait( |
| 549 current_connection_id_) && | 549 current_connection_id_) && |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 void QuicDispatcher::DeliverPacketsToSession( | 987 void QuicDispatcher::DeliverPacketsToSession( |
| 988 const std::list<BufferedPacket>& packets, | 988 const std::list<BufferedPacket>& packets, |
| 989 QuicSession* session) { | 989 QuicSession* session) { |
| 990 for (const BufferedPacket& packet : packets) { | 990 for (const BufferedPacket& packet : packets) { |
| 991 session->ProcessUdpPacket(packet.server_address, packet.client_address, | 991 session->ProcessUdpPacket(packet.server_address, packet.client_address, |
| 992 *(packet.packet)); | 992 *(packet.packet)); |
| 993 } | 993 } |
| 994 } | 994 } |
| 995 | 995 |
| 996 } // namespace net | 996 } // namespace net |
| OLD | NEW |