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

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

Issue 1135113003: Added support for stateless time-wait entries. Will be used in a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Remove_flag_quic_use_optimized_packet_reader_93331362
Patch Set: Created 5 years, 7 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 | « no previous file | 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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
OLDNEW
« no previous file with comments | « no previous file | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698