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

Side by Side Diff: net/quic/quic_spdy_stream.cc

Issue 1541263002: Landing Recent QUIC changes until 12/18/2015 13:57 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: replace -1 with 0xff for InvalidPathId Created 4 years, 11 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/quic/quic_session_test.cc ('k') | net/quic/quic_spdy_stream_test.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/quic/quic_spdy_stream.h" 5 #include "net/quic/quic_spdy_stream.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "net/quic/quic_spdy_session.h" 9 #include "net/quic/quic_spdy_session.h"
10 #include "net/quic/quic_utils.h" 10 #include "net/quic/quic_utils.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 } 188 }
189 if (FinishedReadingHeaders()) { 189 if (FinishedReadingHeaders()) {
190 sequencer()->SetUnblocked(); 190 sequencer()->SetUnblocked();
191 } 191 }
192 } 192 }
193 193
194 void QuicSpdyStream::OnTrailingHeadersComplete(bool fin, size_t /*frame_len*/) { 194 void QuicSpdyStream::OnTrailingHeadersComplete(bool fin, size_t /*frame_len*/) {
195 DCHECK(!trailers_decompressed_); 195 DCHECK(!trailers_decompressed_);
196 if (fin_received()) { 196 if (fin_received()) {
197 DLOG(ERROR) << "Received Trailers after FIN, on stream: " << id(); 197 DLOG(ERROR) << "Received Trailers after FIN, on stream: " << id();
198 session()->CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA); 198 session()->CloseConnectionWithDetails(QUIC_INVALID_HEADERS_STREAM_DATA,
199 "Trailers after fin");
199 return; 200 return;
200 } 201 }
201 if (!fin) { 202 if (!fin) {
202 DLOG(ERROR) << "Trailers must have FIN set, on stream: " << id(); 203 DLOG(ERROR) << "Trailers must have FIN set, on stream: " << id();
203 session()->CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA); 204 session()->CloseConnectionWithDetails(QUIC_INVALID_HEADERS_STREAM_DATA,
205 "Fin missing from trailers");
204 return; 206 return;
205 } 207 }
206 trailers_decompressed_ = true; 208 trailers_decompressed_ = true;
207 } 209 }
208 210
209 void QuicSpdyStream::OnStreamReset(const QuicRstStreamFrame& frame) { 211 void QuicSpdyStream::OnStreamReset(const QuicRstStreamFrame& frame) {
210 if (frame.error_code != QUIC_STREAM_NO_ERROR || 212 if (frame.error_code != QUIC_STREAM_NO_ERROR ||
211 version() <= QUIC_VERSION_28) { 213 version() <= QUIC_VERSION_28) {
212 ReliableQuicStream::OnStreamReset(frame); 214 ReliableQuicStream::OnStreamReset(frame);
213 return; 215 return;
(...skipping 25 matching lines...) Expand all
239 if (!FLAGS_quic_supports_trailers) { 241 if (!FLAGS_quic_supports_trailers) {
240 return true; 242 return true;
241 } 243 }
242 // If no further trailing headers are expected, and the decompressed trailers 244 // If no further trailing headers are expected, and the decompressed trailers
243 // (if any) have been consumed, then reading of trailers is finished. 245 // (if any) have been consumed, then reading of trailers is finished.
244 bool no_more_trailers = fin_received() || trailers_decompressed_; 246 bool no_more_trailers = fin_received() || trailers_decompressed_;
245 return no_more_trailers && decompressed_trailers_.empty(); 247 return no_more_trailers && decompressed_trailers_.empty();
246 } 248 }
247 249
248 } // namespace net 250 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_session_test.cc ('k') | net/quic/quic_spdy_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698