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

Unified Diff: net/quic/quic_spdy_stream.cc

Issue 1776423004: Only MarkTrailersConsumed when actually sending trailers notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add internal changes and fix tests Created 4 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/quic/quic_spdy_stream.h ('k') | net/quic/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/quic_spdy_stream.cc
diff --git a/net/quic/quic_spdy_stream.cc b/net/quic/quic_spdy_stream.cc
index 75b160e2d72501343580e81d2fc9c2445427e4d2..3486593d0a096fe4dc1748dfaf1bbfa574bb2308 100644
--- a/net/quic/quic_spdy_stream.cc
+++ b/net/quic/quic_spdy_stream.cc
@@ -10,6 +10,7 @@
#include "net/quic/quic_spdy_session.h"
#include "net/quic/quic_utils.h"
#include "net/quic/quic_write_blocked_list.h"
+#include "net/quic/spdy_utils.h"
using base::StringPiece;
using std::min;
@@ -213,7 +214,22 @@ void QuicSpdyStream::OnTrailingHeadersComplete(bool fin, size_t /*frame_len*/) {
return;
}
- OnStreamFrame(QuicStreamFrame(id(), fin, stream_bytes_read(), StringPiece()));
+ size_t final_byte_offset = 0;
+ SpdyHeaderBlock trailers;
+ if (!SpdyUtils::ParseTrailers(decompressed_trailers().data(),
+ decompressed_trailers().length(),
+ &final_byte_offset, &response_trailers_)) {
+ DLOG(ERROR) << "Trailers are malformed: " << id();
+ session()->connection()->SendConnectionCloseWithDetails(
+ QUIC_INVALID_HEADERS_STREAM_DATA, "Trailers are malformed");
+ return;
+ }
+
+ // The data on this stream ends at |final_byte_offset|.
+ DVLOG(1) << "Stream ends at byte offset: " << final_byte_offset
+ << " currently read: " << stream_bytes_read();
+
+ OnStreamFrame(QuicStreamFrame(id(), fin, final_byte_offset, StringPiece()));
trailers_decompressed_ = true;
}
« no previous file with comments | « net/quic/quic_spdy_stream.h ('k') | net/quic/quic_spdy_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698