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

Unified Diff: net/quic/core/quic_connection.cc

Issue 2820263005: In QUIC version >= 38, enables random padding of size [1, 256] (Closed)
Patch Set: Created 3 years, 8 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/core/quic_connection.cc
diff --git a/net/quic/core/quic_connection.cc b/net/quic/core/quic_connection.cc
index 93232b5802d302d4cafdfd764b4f6790a3dd1147..e4fbc708ae0c1b0080d9f67cba621d698ef22037 100644
--- a/net/quic/core/quic_connection.cc
+++ b/net/quic/core/quic_connection.cc
@@ -1058,9 +1058,9 @@ QuicConsumedData QuicConnection::SendStreamData(
QuicStreamId id,
QuicIOVector iov,
QuicStreamOffset offset,
- bool fin,
+ StreamSendingState state,
QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener) {
- if (!fin && iov.total_length == 0) {
+ if (state == NO_FIN && iov.total_length == 0) {
QUIC_BUG << "Attempt to send empty stream frame";
return QuicConsumedData(0, false);
}
@@ -1075,12 +1075,12 @@ QuicConsumedData QuicConnection::SendStreamData(
// The optimized path may be used for data only packets which fit into a
// standard buffer and don't need padding.
if (id != kCryptoStreamId && !packet_generator_.HasQueuedFrames() &&
- iov.total_length > kMaxPacketSize) {
+ iov.total_length > kMaxPacketSize && state != FIN_AND_PADDING) {
// Use the fast path to send full data packets.
- return packet_generator_.ConsumeDataFastPath(id, iov, offset, fin,
- std::move(ack_listener));
+ return packet_generator_.ConsumeDataFastPath(
+ id, iov, offset, state != NO_FIN, std::move(ack_listener));
}
- return packet_generator_.ConsumeData(id, iov, offset, fin ? FIN : NO_FIN,
+ return packet_generator_.ConsumeData(id, iov, offset, state,
std::move(ack_listener));
}

Powered by Google App Engine
This is Rietveld 408576698