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

Unified Diff: net/tools/quic/quic_spdy_client_stream.cc

Issue 1908103002: Landing Recent QUIC changes until 4/15/2016 17:20 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix 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/tools/quic/quic_spdy_client_stream.h ('k') | net/tools/quic/quic_spdy_client_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_spdy_client_stream.cc
diff --git a/net/tools/quic/quic_spdy_client_stream.cc b/net/tools/quic/quic_spdy_client_stream.cc
index 8ac758a5236a220891d8ab6a8f72ad7cbf33e3c8..ca3bd78312480109a7009278adbcc82ac79b0bcb 100644
--- a/net/tools/quic/quic_spdy_client_stream.cc
+++ b/net/tools/quic/quic_spdy_client_stream.cc
@@ -68,6 +68,34 @@ void QuicSpdyClientStream::OnInitialHeadersComplete(bool fin,
session_->OnInitialHeadersComplete(id(), response_headers_);
}
+void QuicSpdyClientStream::OnInitialHeadersComplete(
+ bool fin,
+ size_t frame_len,
+ const QuicHeaderList& header_list) {
+ QuicSpdyStream::OnInitialHeadersComplete(fin, frame_len, header_list);
+
+ DCHECK(headers_decompressed());
+ header_bytes_read_ += frame_len;
+ if (!SpdyUtils::CopyAndValidateHeaders(header_list, &content_length_,
+ &response_headers_)) {
+ DLOG(ERROR) << "Failed to parse header list: " << header_list.DebugString();
+ Reset(QUIC_BAD_APPLICATION_PAYLOAD);
+ return;
+ }
+
+ if (!ParseHeaderStatusCode(&response_headers_, &response_code_)) {
+ DLOG(ERROR) << "Received invalid response code: "
+ << response_headers_[":status"].as_string();
+ Reset(QUIC_BAD_APPLICATION_PAYLOAD);
+ return;
+ }
+
+ ConsumeHeaderList();
+ DVLOG(1) << "headers complete for stream " << id();
+
+ session_->OnInitialHeadersComplete(id(), response_headers_);
+}
+
void QuicSpdyClientStream::OnTrailingHeadersComplete(bool fin,
size_t frame_len) {
QuicSpdyStream::OnTrailingHeadersComplete(fin, frame_len);
@@ -90,6 +118,27 @@ void QuicSpdyClientStream::OnPromiseHeadersComplete(QuicStreamId promised_id,
MarkHeadersConsumed(decompressed_headers().length());
session_->HandlePromised(id(), promised_id, promise_headers);
+ if (visitor() != nullptr) {
+ visitor()->OnPromiseHeadersComplete(promised_id, frame_len);
+ }
+}
+
+void QuicSpdyClientStream::OnPromiseHeaderList(
+ QuicStreamId promised_id,
+ size_t frame_len,
+ const QuicHeaderList& header_list) {
+ header_bytes_read_ += frame_len;
+ int64_t content_length = -1;
+ SpdyHeaderBlock promise_headers;
+ if (!SpdyUtils::CopyAndValidateHeaders(header_list, &content_length,
+ &promise_headers)) {
+ DLOG(ERROR) << "Failed to parse promise headers: "
+ << header_list.DebugString();
+ Reset(QUIC_BAD_APPLICATION_PAYLOAD);
+ return;
+ }
+
+ session_->HandlePromised(id(), promised_id, promise_headers);
}
void QuicSpdyClientStream::OnDataAvailable() {
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream.h ('k') | net/tools/quic/quic_spdy_client_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698