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

Unified Diff: net/spdy/spdy_framer.cc

Issue 959743002: Account for HTTP/2 padding in receive windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more mock implementation. Created 5 years, 9 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/spdy/spdy_framer.h ('k') | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_framer.cc
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index 5ae6e94a5e76252367fcaf690bf4726e6a5bb9fd..ea5eaa564b3b9b92667fd03bac10d1f59ce1a943 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -2160,10 +2160,13 @@ size_t SpdyFramer::ProcessDataFramePaddingLength(const char* data, size_t len) {
return 0;
}
+ static_assert(kPadLengthFieldSize == 1,
+ "Unexpected pad length field size.");
remaining_padding_payload_length_ = *reinterpret_cast<const uint8*>(data);
++data;
--len;
--remaining_data_length_;
+ visitor_->OnStreamPadding(current_frame_stream_id_, kPadLengthFieldSize);
} else {
// We don't have the data available for parsing the pad length field. Keep
// waiting.
@@ -2187,11 +2190,8 @@ size_t SpdyFramer::ProcessFramePadding(const char* data, size_t len) {
DCHECK_EQ(remaining_padding_payload_length_, remaining_data_length_);
size_t amount_to_discard = std::min(remaining_padding_payload_length_, len);
if (current_frame_type_ == DATA && amount_to_discard > 0) {
- // The visitor needs to know about padding so it can send window updates.
- // Communicate the padding to the visitor through a NULL data pointer,
- // with a nonzero size.
- visitor_->OnStreamFrameData(
- current_frame_stream_id_, NULL, amount_to_discard, false);
+ DCHECK_LE(SPDY4, protocol_version());
+ visitor_->OnStreamPadding(current_frame_stream_id_, amount_to_discard);
}
data += amount_to_discard;
len -= amount_to_discard;
« no previous file with comments | « net/spdy/spdy_framer.h ('k') | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698