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/quic/core/quic_packet_creator.h" | 5 #include "net/quic/core/quic_packet_creator.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstdint> | 8 #include <cstdint> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 | 539 |
540 // TODO(jri): Make this a public method of framer? | 540 // TODO(jri): Make this a public method of framer? |
541 SerializedPacket QuicPacketCreator::NoPacket() { | 541 SerializedPacket QuicPacketCreator::NoPacket() { |
542 return SerializedPacket(0, PACKET_1BYTE_PACKET_NUMBER, nullptr, 0, false, | 542 return SerializedPacket(0, PACKET_1BYTE_PACKET_NUMBER, nullptr, 0, false, |
543 false); | 543 false); |
544 } | 544 } |
545 | 545 |
546 void QuicPacketCreator::FillPacketHeader(QuicPacketHeader* header) { | 546 void QuicPacketCreator::FillPacketHeader(QuicPacketHeader* header) { |
547 header->public_header.connection_id = connection_id_; | 547 header->public_header.connection_id = connection_id_; |
548 header->public_header.connection_id_length = connection_id_length_; | 548 header->public_header.connection_id_length = connection_id_length_; |
549 header->public_header.multipath_flag = false; | |
550 header->public_header.reset_flag = false; | 549 header->public_header.reset_flag = false; |
551 header->public_header.version_flag = send_version_in_packet_; | 550 header->public_header.version_flag = send_version_in_packet_; |
552 if (IncludeNonceInPublicHeader()) { | 551 if (IncludeNonceInPublicHeader()) { |
553 DCHECK_EQ(Perspective::IS_SERVER, framer_->perspective()); | 552 DCHECK_EQ(Perspective::IS_SERVER, framer_->perspective()); |
554 header->public_header.nonce = &diversification_nonce_; | 553 header->public_header.nonce = &diversification_nonce_; |
555 } else { | 554 } else { |
556 header->public_header.nonce = nullptr; | 555 header->public_header.nonce = nullptr; |
557 } | 556 } |
558 header->packet_number = ++packet_.packet_number; | 557 header->packet_number = ++packet_.packet_number; |
559 header->public_header.packet_number_length = packet_.packet_number_length; | 558 header->public_header.packet_number_length = packet_.packet_number_length; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 bool QuicPacketCreator::IncludeNonceInPublicHeader() { | 656 bool QuicPacketCreator::IncludeNonceInPublicHeader() { |
658 return have_diversification_nonce_ && | 657 return have_diversification_nonce_ && |
659 packet_.encryption_level == ENCRYPTION_INITIAL; | 658 packet_.encryption_level == ENCRYPTION_INITIAL; |
660 } | 659 } |
661 | 660 |
662 void QuicPacketCreator::AddPendingPadding(QuicByteCount size) { | 661 void QuicPacketCreator::AddPendingPadding(QuicByteCount size) { |
663 pending_padding_bytes_ += size; | 662 pending_padding_bytes_ += size; |
664 } | 663 } |
665 | 664 |
666 } // namespace net | 665 } // namespace net |
OLD | NEW |