| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/quic/quic_dispatcher.h" | 5 #include "net/quic/quic_dispatcher.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 242 |
| 243 // Use the version in the packet if possible, otherwise assume the latest. | 243 // Use the version in the packet if possible, otherwise assume the latest. |
| 244 QuicVersion version = header.version_flag ? header.versions.front() : | 244 QuicVersion version = header.version_flag ? header.versions.front() : |
| 245 supported_versions_.front(); | 245 supported_versions_.front(); |
| 246 time_wait_list_manager_->AddConnectionIdToTimeWait(connection_id, version, | 246 time_wait_list_manager_->AddConnectionIdToTimeWait(connection_id, version, |
| 247 nullptr); | 247 nullptr); |
| 248 DCHECK(time_wait_list_manager_->IsConnectionIdInTimeWait(connection_id)); | 248 DCHECK(time_wait_list_manager_->IsConnectionIdInTimeWait(connection_id)); |
| 249 return HandlePacketForTimeWait(header); | 249 return HandlePacketForTimeWait(header); |
| 250 } | 250 } |
| 251 DVLOG(1) << "Created new session for " << connection_id; | 251 DVLOG(1) << "Created new session for " << connection_id; |
| 252 session_map_.insert(make_pair(connection_id, session)); | 252 session_map_.insert(std::make_pair(connection_id, session)); |
| 253 } else { | 253 } else { |
| 254 session = it->second; | 254 session = it->second; |
| 255 } | 255 } |
| 256 | 256 |
| 257 session->connection()->ProcessUdpPacket( | 257 session->connection()->ProcessUdpPacket( |
| 258 current_server_address_, current_client_address_, *current_packet_); | 258 current_server_address_, current_client_address_, *current_packet_); |
| 259 | 259 |
| 260 // Do not parse the packet further. The session will process it completely. | 260 // Do not parse the packet further. The session will process it completely. |
| 261 return false; | 261 return false; |
| 262 } | 262 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 337 |
| 338 void QuicDispatcher::OnWriteBlocked( | 338 void QuicDispatcher::OnWriteBlocked( |
| 339 QuicBlockedWriterInterface* blocked_writer) { | 339 QuicBlockedWriterInterface* blocked_writer) { |
| 340 if (!writer_->IsWriteBlocked()) { | 340 if (!writer_->IsWriteBlocked()) { |
| 341 LOG(DFATAL) << | 341 LOG(DFATAL) << |
| 342 "QuicDispatcher::OnWriteBlocked called when the writer is not blocked."; | 342 "QuicDispatcher::OnWriteBlocked called when the writer is not blocked."; |
| 343 // Return without adding the connection to the blocked list, to avoid | 343 // Return without adding the connection to the blocked list, to avoid |
| 344 // infinite loops in OnCanWrite. | 344 // infinite loops in OnCanWrite. |
| 345 return; | 345 return; |
| 346 } | 346 } |
| 347 write_blocked_list_.insert(make_pair(blocked_writer, true)); | 347 write_blocked_list_.insert(std::make_pair(blocked_writer, true)); |
| 348 } | 348 } |
| 349 | 349 |
| 350 void QuicDispatcher::OnConnectionAddedToTimeWaitList( | 350 void QuicDispatcher::OnConnectionAddedToTimeWaitList( |
| 351 QuicConnectionId connection_id) { | 351 QuicConnectionId connection_id) { |
| 352 DVLOG(1) << "Connection " << connection_id << " added to time wait list."; | 352 DVLOG(1) << "Connection " << connection_id << " added to time wait list."; |
| 353 } | 353 } |
| 354 | 354 |
| 355 void QuicDispatcher::OnConnectionRemovedFromTimeWaitList( | 355 void QuicDispatcher::OnConnectionRemovedFromTimeWaitList( |
| 356 QuicConnectionId connection_id) { | 356 QuicConnectionId connection_id) { |
| 357 DVLOG(1) << "Connection " << connection_id << " removed from time wait list."; | 357 DVLOG(1) << "Connection " << connection_id << " removed from time wait list."; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 // be parsed correctly. | 399 // be parsed correctly. |
| 400 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId( | 400 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId( |
| 401 header.connection_id)); | 401 header.connection_id)); |
| 402 | 402 |
| 403 // Continue parsing the packet to extract the sequence number. Then | 403 // Continue parsing the packet to extract the sequence number. Then |
| 404 // send it to the time wait manager in OnUnathenticatedHeader. | 404 // send it to the time wait manager in OnUnathenticatedHeader. |
| 405 return true; | 405 return true; |
| 406 } | 406 } |
| 407 | 407 |
| 408 } // namespace net | 408 } // namespace net |
| OLD | NEW |