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

Unified Diff: net/quic/quic_packet_creator.cc

Issue 478153003: Change the wire format of the ack frame to include a compressed version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/quic_packet_creator.cc
diff --git a/net/quic/quic_packet_creator.cc b/net/quic/quic_packet_creator.cc
index 1c3a1a82725d54c632fea0918ee647ce32ff231b..1ca834efc842aef2a9f746dc536d13b10f67c144 100644
--- a/net/quic/quic_packet_creator.cc
+++ b/net/quic/quic_packet_creator.cc
@@ -379,19 +379,20 @@ SerializedPacket QuicPacketCreator::SerializePacket() {
size_t max_plaintext_size =
framer_->GetMaxPlaintextSize(max_packet_length_);
DCHECK_GE(max_plaintext_size, packet_size_);
- // ACK Frames will be truncated only if they're the only frame in the packet,
- // and if packet_size_ was set to max_plaintext_size. If truncation occurred,
- // then GetSerializedFrameLength will have returned all bytes free.
- bool possibly_truncated = packet_size_ == max_plaintext_size &&
- queued_frames_.size() == 1 &&
- queued_frames_.back().type == ACK_FRAME;
+ // ACK Frames will be truncated due to length only if they're the only frame
+ // in the packet, and if packet_size_ was set to max_plaintext_size. If
+ // truncation due to length occurred, then GetSerializedFrameLength will have
+ // returned all bytes free.
+ bool possibly_truncated_by_length = packet_size_ == max_plaintext_size &&
+ queued_frames_.size() == 1 &&
+ queued_frames_.back().type == ACK_FRAME;
SerializedPacket serialized =
framer_->BuildDataPacket(header, queued_frames_, packet_size_);
LOG_IF(DFATAL, !serialized.packet)
<< "Failed to serialize " << queued_frames_.size() << " frames.";
// Because of possible truncation, we can't be confident that our
// packet size calculation worked correctly.
- if (!possibly_truncated) {
+ if (!possibly_truncated_by_length) {
DCHECK_EQ(packet_size_, serialized.packet->length());
}
packet_size_ = 0;

Powered by Google App Engine
This is Rietveld 408576698