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

Side by Side Diff: net/quic/core/quic_packet_creator.cc

Issue 2543833003: Remove call to SetMaxPacketLength from QuicPacketCreator::OnSerializedPacket, as it will always be … (Closed)
Patch Set: Created 4 years 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 | no next file » | 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/quic/core/quic_packet_creator.h" 5 #include "net/quic/core/quic_packet_creator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 const string error_details = "Failed to SerializePacket."; 328 const string error_details = "Failed to SerializePacket.";
329 QUIC_BUG << error_details; 329 QUIC_BUG << error_details;
330 delegate_->OnUnrecoverableError(QUIC_FAILED_TO_SERIALIZE_PACKET, 330 delegate_->OnUnrecoverableError(QUIC_FAILED_TO_SERIALIZE_PACKET,
331 error_details, 331 error_details,
332 ConnectionCloseSource::FROM_SELF); 332 ConnectionCloseSource::FROM_SELF);
333 return; 333 return;
334 } 334 }
335 335
336 delegate_->OnSerializedPacket(&packet_); 336 delegate_->OnSerializedPacket(&packet_);
337 ClearPacket(); 337 ClearPacket();
338 // Maximum packet size may be only enacted while no packet is currently being
339 // constructed, so here we have a good opportunity to actually change it.
340 if (CanSetMaxPacketLength()) {
341 SetMaxPacketLength(max_packet_length_);
342 }
343 } 338 }
344 339
345 void QuicPacketCreator::ClearPacket() { 340 void QuicPacketCreator::ClearPacket() {
346 packet_.has_ack = false; 341 packet_.has_ack = false;
347 packet_.has_stop_waiting = false; 342 packet_.has_stop_waiting = false;
348 packet_.has_crypto_handshake = NOT_HANDSHAKE; 343 packet_.has_crypto_handshake = NOT_HANDSHAKE;
349 packet_.num_padding_bytes = 0; 344 packet_.num_padding_bytes = 0;
350 packet_.original_path_id = kInvalidPathId; 345 packet_.original_path_id = kInvalidPathId;
351 packet_.original_packet_number = 0; 346 packet_.original_packet_number = 0;
352 packet_.transmission_type = NOT_RETRANSMISSION; 347 packet_.transmission_type = NOT_RETRANSMISSION;
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 // Switching path needs to update packet number length. 659 // Switching path needs to update packet number length.
665 UpdatePacketNumberLength(least_packet_awaited_by_peer, max_packets_in_flight); 660 UpdatePacketNumberLength(least_packet_awaited_by_peer, max_packets_in_flight);
666 } 661 }
667 662
668 bool QuicPacketCreator::IncludeNonceInPublicHeader() { 663 bool QuicPacketCreator::IncludeNonceInPublicHeader() {
669 return have_diversification_nonce_ && 664 return have_diversification_nonce_ &&
670 packet_.encryption_level == ENCRYPTION_INITIAL; 665 packet_.encryption_level == ENCRYPTION_INITIAL;
671 } 666 }
672 667
673 } // namespace net 668 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698