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

Side by Side Diff: net/tools/quic/quic_spdy_client_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 unified diff | Download patch
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream.h ('k') | net/tools/quic/test_tools/quic_test_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/tools/quic/quic_spdy_client_stream.h" 5 #include "net/tools/quic/quic_spdy_client_stream.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "net/quic/quic_alarm.h" 10 #include "net/quic/quic_alarm.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 return; 65 return;
66 } 66 }
67 MarkHeadersConsumed(decompressed_headers().length()); 67 MarkHeadersConsumed(decompressed_headers().length());
68 DVLOG(1) << "headers complete for stream " << id(); 68 DVLOG(1) << "headers complete for stream " << id();
69 69
70 session_->OnInitialHeadersComplete(id(), response_headers_); 70 session_->OnInitialHeadersComplete(id(), response_headers_);
71 } 71 }
72 72
73 void QuicSpdyClientStream::OnTrailingHeadersComplete(bool fin, 73 void QuicSpdyClientStream::OnTrailingHeadersComplete(bool fin,
74 size_t frame_len) { 74 size_t frame_len) {
75 size_t final_byte_offset = 0; 75 QuicSpdyStream::OnTrailingHeadersComplete(fin, frame_len);
76 if (!SpdyUtils::ParseTrailers(decompressed_trailers().data(),
77 decompressed_trailers().length(),
78 &final_byte_offset, &response_trailers_)) {
79 Reset(QUIC_BAD_APPLICATION_PAYLOAD);
80 return;
81 }
82 MarkTrailersConsumed(decompressed_trailers().length()); 76 MarkTrailersConsumed(decompressed_trailers().length());
83
84 // The data on this stream ends at |final_byte_offset|.
85 DVLOG(1) << "Stream ends at byte offset: " << final_byte_offset
86 << " currently read: " << stream_bytes_read();
87 OnStreamFrame(
88 QuicStreamFrame(id(), /*fin=*/true, final_byte_offset, StringPiece()));
89 } 77 }
90 78
91 void QuicSpdyClientStream::OnPromiseHeadersComplete(QuicStreamId promised_id, 79 void QuicSpdyClientStream::OnPromiseHeadersComplete(QuicStreamId promised_id,
92 size_t frame_len) { 80 size_t frame_len) {
93 header_bytes_read_ += frame_len; 81 header_bytes_read_ += frame_len;
94 int content_length = -1; 82 int content_length = -1;
95 SpdyHeaderBlock promise_headers; 83 SpdyHeaderBlock promise_headers;
96 if (!SpdyUtils::ParseHeaders(decompressed_headers().data(), 84 if (!SpdyUtils::ParseHeaders(decompressed_headers().data(),
97 decompressed_headers().length(), &content_length, 85 decompressed_headers().length(), &content_length,
98 &promise_headers)) { 86 &promise_headers)) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 SendBody(data, fin, nullptr); 143 SendBody(data, fin, nullptr);
156 } 144 }
157 145
158 void QuicSpdyClientStream::SendBody(const string& data, 146 void QuicSpdyClientStream::SendBody(const string& data,
159 bool fin, 147 bool fin,
160 QuicAckListenerInterface* listener) { 148 QuicAckListenerInterface* listener) {
161 WriteOrBufferData(data, fin, listener); 149 WriteOrBufferData(data, fin, listener);
162 } 150 }
163 151
164 } // namespace net 152 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream.h ('k') | net/tools/quic/test_tools/quic_test_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698