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

Unified Diff: net/quic/quic_framer.cc

Issue 1918953003: Landing Recent QUIC changes until 4/22/2016 14:55 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Deleted SpdyFramerTests missed while mergeing 120451808 Created 4 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
« no previous file with comments | « net/quic/quic_framer.h ('k') | net/quic/quic_framer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_framer.cc
diff --git a/net/quic/quic_framer.cc b/net/quic/quic_framer.cc
index 852114a0c245104ab511b6e8578eafd540b6119a..59052ac96b90b26e9ec37533f2461c760ba01c0e 100644
--- a/net/quic/quic_framer.cc
+++ b/net/quic/quic_framer.cc
@@ -278,9 +278,18 @@ size_t QuicFramer::GetSerializedFrameLength(
return 0;
}
if (frame.type == PADDING_FRAME) {
- // PADDING implies end of packet.
- return free_bytes;
+ if (frame.padding_frame.num_padding_bytes == -1) {
+ // Full padding to the end of the packet.
+ return free_bytes;
+ } else {
+ // Lite padding.
+ return free_bytes <
+ static_cast<size_t>(frame.padding_frame.num_padding_bytes)
+ ? free_bytes
+ : frame.padding_frame.num_padding_bytes;
+ }
}
+
size_t frame_len =
ComputeFrameLength(frame, last_frame, packet_number_length);
if (frame_len <= free_bytes) {
@@ -1101,9 +1110,14 @@ bool QuicFramer::ProcessFrameData(QuicDataReader* reader,
}
switch (frame_type) {
- case PADDING_FRAME:
+ case PADDING_FRAME: {
+ QuicPaddingFrame frame(reader->BytesRemaining());
+ if (!visitor_->OnPaddingFrame(frame)) {
+ DVLOG(1) << "Visitor asked to stop further processing.";
+ }
// We're done with the packet.
return true;
+ }
case RST_STREAM_FRAME: {
QuicRstStreamFrame frame;
« no previous file with comments | « net/quic/quic_framer.h ('k') | net/quic/quic_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698