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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 session->connection()->ProcessUdpPacket( | 291 session->connection()->ProcessUdpPacket( |
292 current_server_address_, current_client_address_, *current_packet_); | 292 current_server_address_, current_client_address_, *current_packet_); |
293 break; | 293 break; |
294 } | 294 } |
295 case kFateTimeWait: | 295 case kFateTimeWait: |
296 // Add this connection_id to the time-wait state, to safely reject | 296 // Add this connection_id to the time-wait state, to safely reject |
297 // future packets. | 297 // future packets. |
298 DVLOG(1) << "Adding connection ID " << connection_id | 298 DVLOG(1) << "Adding connection ID " << connection_id |
299 << "to time-wait list."; | 299 << "to time-wait list."; |
300 time_wait_list_manager_->AddConnectionIdToTimeWait( | 300 time_wait_list_manager_->AddConnectionIdToTimeWait( |
301 connection_id, framer_.version(), nullptr); | 301 connection_id, framer_.version(), |
| 302 /*connection_rejected_statelessly=*/false, nullptr); |
302 DCHECK(time_wait_list_manager_->IsConnectionIdInTimeWait( | 303 DCHECK(time_wait_list_manager_->IsConnectionIdInTimeWait( |
303 header.public_header.connection_id)); | 304 header.public_header.connection_id)); |
304 time_wait_list_manager_->ProcessPacket( | 305 time_wait_list_manager_->ProcessPacket( |
305 current_server_address_, current_client_address_, | 306 current_server_address_, current_client_address_, |
306 header.public_header.connection_id, header.packet_sequence_number, | 307 header.public_header.connection_id, header.packet_sequence_number, |
307 *current_packet_); | 308 *current_packet_); |
308 break; | 309 break; |
309 case kFateDrop: | 310 case kFateDrop: |
310 // Do nothing with the packet. | 311 // Do nothing with the packet. |
311 break; | 312 break; |
(...skipping 29 matching lines...) Expand all Loading... |
341 } | 342 } |
342 | 343 |
343 return kFateProcess; | 344 return kFateProcess; |
344 } | 345 } |
345 | 346 |
346 void QuicDispatcher::CleanUpSession(SessionMap::iterator it) { | 347 void QuicDispatcher::CleanUpSession(SessionMap::iterator it) { |
347 QuicConnection* connection = it->second->connection(); | 348 QuicConnection* connection = it->second->connection(); |
348 QuicEncryptedPacket* connection_close_packet = | 349 QuicEncryptedPacket* connection_close_packet = |
349 connection->ReleaseConnectionClosePacket(); | 350 connection->ReleaseConnectionClosePacket(); |
350 write_blocked_list_.erase(connection); | 351 write_blocked_list_.erase(connection); |
351 time_wait_list_manager_->AddConnectionIdToTimeWait(it->first, | 352 time_wait_list_manager_->AddConnectionIdToTimeWait( |
352 connection->version(), | 353 it->first, connection->version(), |
353 connection_close_packet); | 354 /*connection_rejected_statelessly=*/false, connection_close_packet); |
354 session_map_.erase(it); | 355 session_map_.erase(it); |
355 } | 356 } |
356 | 357 |
357 void QuicDispatcher::DeleteSessions() { | 358 void QuicDispatcher::DeleteSessions() { |
358 STLDeleteElements(&closed_session_list_); | 359 STLDeleteElements(&closed_session_list_); |
359 } | 360 } |
360 | 361 |
361 void QuicDispatcher::OnCanWrite() { | 362 void QuicDispatcher::OnCanWrite() { |
362 // The socket is now writable. | 363 // The socket is now writable. |
363 writer_->SetWritable(); | 364 writer_->SetWritable(); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId( | 465 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId( |
465 header.connection_id)); | 466 header.connection_id)); |
466 | 467 |
467 // Continue parsing the packet to extract the sequence number. Then | 468 // Continue parsing the packet to extract the sequence number. Then |
468 // send it to the time wait manager in OnUnathenticatedHeader. | 469 // send it to the time wait manager in OnUnathenticatedHeader. |
469 return true; | 470 return true; |
470 } | 471 } |
471 | 472 |
472 } // namespace tools | 473 } // namespace tools |
473 } // namespace net | 474 } // namespace net |
OLD | NEW |