Index: net/quic/quic_packet_generator.cc |
diff --git a/net/quic/quic_packet_generator.cc b/net/quic/quic_packet_generator.cc |
index 952bdc266df9333e60e425f012cd2d2e72a6bcb6..9e7473ebbf06fd39f9cd6ad85daac74f02d86509 100644 |
--- a/net/quic/quic_packet_generator.cc |
+++ b/net/quic/quic_packet_generator.cc |
@@ -97,7 +97,11 @@ QuicConsumedData QuicPacketGenerator::ConsumeData(QuicStreamId id, |
FecProtection fec_protection, |
QuicAckNotifier* notifier) { |
IsHandshake handshake = id == kCryptoStreamId ? IS_HANDSHAKE : NOT_HANDSHAKE; |
- SendQueuedFrames(false); |
+ // To make reasoning about crypto frames easier, we don't combine them with |
+ // other retransmittable frames in a single packet. |
+ const bool flush = handshake == IS_HANDSHAKE && |
+ packet_creator_.HasPendingRetransmittableFrames(); |
+ SendQueuedFrames(flush); |
size_t total_bytes_consumed = 0; |
bool fin_consumed = false; |
@@ -155,6 +159,11 @@ QuicConsumedData QuicPacketGenerator::ConsumeData(QuicStreamId id, |
} |
} |
+ // Don't allow the handshake to be bundled with other retransmittable frames. |
+ if (handshake == IS_HANDSHAKE) { |
+ SendQueuedFrames(true); |
+ } |
+ |
// Try to close FEC group since we've either run out of data to send or we're |
// blocked. If not in batch mode, force close the group. |
MaybeSendFecPacketAndCloseGroup(!InBatchMode()); |