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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 header.packet_number > kMaxReasonableInitialPacketNumber) { | 352 header.packet_number > kMaxReasonableInitialPacketNumber) { |
353 return kFateTimeWait; | 353 return kFateTimeWait; |
354 } | 354 } |
355 | 355 |
356 return kFateProcess; | 356 return kFateProcess; |
357 } | 357 } |
358 | 358 |
359 void QuicDispatcher::CleanUpSession(SessionMap::iterator it, | 359 void QuicDispatcher::CleanUpSession(SessionMap::iterator it, |
360 bool should_close_statelessly) { | 360 bool should_close_statelessly) { |
361 QuicConnection* connection = it->second->connection(); | 361 QuicConnection* connection = it->second->connection(); |
362 QuicEncryptedPacket* connection_close_packet = | 362 |
363 connection->ReleaseConnectionClosePacket(); | |
364 write_blocked_list_.erase(connection); | 363 write_blocked_list_.erase(connection); |
365 DCHECK(!should_close_statelessly || !connection_close_packet); | 364 if (should_close_statelessly) { |
| 365 DCHECK(connection->termination_packets() != nullptr && |
| 366 !connection->termination_packets()->empty()); |
| 367 } |
366 time_wait_list_manager_->AddConnectionIdToTimeWait( | 368 time_wait_list_manager_->AddConnectionIdToTimeWait( |
367 it->first, connection->version(), should_close_statelessly, | 369 it->first, connection->version(), should_close_statelessly, |
368 connection_close_packet); | 370 connection->termination_packets()); |
369 session_map_.erase(it); | 371 session_map_.erase(it); |
370 } | 372 } |
371 | 373 |
372 void QuicDispatcher::DeleteSessions() { | 374 void QuicDispatcher::DeleteSessions() { |
373 STLDeleteElements(&closed_session_list_); | 375 STLDeleteElements(&closed_session_list_); |
374 } | 376 } |
375 | 377 |
376 void QuicDispatcher::OnCanWrite() { | 378 void QuicDispatcher::OnCanWrite() { |
377 // The socket is now writable. | 379 // The socket is now writable. |
378 writer_->SetWritable(); | 380 writer_->SetWritable(); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 // send it to the time wait manager in OnUnathenticatedHeader. | 496 // send it to the time wait manager in OnUnathenticatedHeader. |
495 return true; | 497 return true; |
496 } | 498 } |
497 | 499 |
498 void QuicDispatcher::SetLastError(QuicErrorCode error) { | 500 void QuicDispatcher::SetLastError(QuicErrorCode error) { |
499 last_error_ = error; | 501 last_error_ = error; |
500 } | 502 } |
501 | 503 |
502 } // namespace tools | 504 } // namespace tools |
503 } // namespace net | 505 } // namespace net |
OLD | NEW |