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

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

Issue 2430513002: Limit QUIC uncompressed header size per stream to 16K, by default. Protected by FLAGS_quic_limit_un… (Closed)
Patch Set: Created 4 years, 2 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/core/quic_spdy_stream.h ('k') | net/quic/core/quic_spdy_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_spdy_stream.cc
diff --git a/net/quic/core/quic_spdy_stream.cc b/net/quic/core/quic_spdy_stream.cc
index 0a6d1049a1de9fd78dcdcbdc43c273e2309a4ce6..502145c66de315a6500f3412cbd1ad03535c73bb 100644
--- a/net/quic/core/quic_spdy_stream.cc
+++ b/net/quic/core/quic_spdy_stream.cc
@@ -205,6 +205,16 @@ void QuicSpdyStream::OnStreamHeadersComplete(bool fin, size_t frame_len) {
void QuicSpdyStream::OnStreamHeaderList(bool fin,
size_t frame_len,
const QuicHeaderList& header_list) {
+ // The headers list avoid infinite buffering by clearing the headers list
+ // if the current headers are too large. So if the list is empty here
+ // then the headers list must have been too large, and the stream should
+ // be reset.
+ if (FLAGS_quic_limit_uncompressed_headers && header_list.empty()) {
+ OnHeadersTooLarge();
+ if (IsDoneReading()) {
+ return;
+ }
+ }
if (!headers_decompressed_) {
OnInitialHeadersComplete(fin, frame_len, header_list);
} else {
@@ -212,6 +222,10 @@ void QuicSpdyStream::OnStreamHeaderList(bool fin,
}
}
+void QuicSpdyStream::OnHeadersTooLarge() {
+ Reset(QUIC_HEADERS_TOO_LARGE);
+}
+
void QuicSpdyStream::OnInitialHeadersComplete(bool fin, size_t /*frame_len*/) {
headers_decompressed_ = true;
if (fin) {
« no previous file with comments | « net/quic/core/quic_spdy_stream.h ('k') | net/quic/core/quic_spdy_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698