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

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

Issue 2430973004: Landing Recent QUIC changes until 10:38 AM, Oct 17, 2016 UTC-4 (Closed)
Patch Set: Improving flagsaver logging 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 unified diff | 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 »
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/core/quic_spdy_stream.h" 5 #include "net/quic/core/quic_spdy_stream.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 11 matching lines...) Expand all
22 namespace net { 22 namespace net {
23 23
24 #define ENDPOINT \ 24 #define ENDPOINT \
25 (session()->perspective() == Perspective::IS_SERVER ? "Server: " : "Client:" \ 25 (session()->perspective() == Perspective::IS_SERVER ? "Server: " : "Client:" \
26 " ") 26 " ")
27 27
28 QuicSpdyStream::QuicSpdyStream(QuicStreamId id, QuicSpdySession* spdy_session) 28 QuicSpdyStream::QuicSpdyStream(QuicStreamId id, QuicSpdySession* spdy_session)
29 : ReliableQuicStream(id, spdy_session), 29 : ReliableQuicStream(id, spdy_session),
30 spdy_session_(spdy_session), 30 spdy_session_(spdy_session),
31 visitor_(nullptr), 31 visitor_(nullptr),
32 allow_bidirectional_data_(false),
32 headers_decompressed_(false), 33 headers_decompressed_(false),
33 priority_(kDefaultPriority), 34 priority_(kDefaultPriority),
34 trailers_decompressed_(false), 35 trailers_decompressed_(false),
35 trailers_consumed_(false) { 36 trailers_consumed_(false) {
36 DCHECK_NE(kCryptoStreamId, id); 37 DCHECK_NE(kCryptoStreamId, id);
37 // Don't receive any callbacks from the sequencer until headers 38 // Don't receive any callbacks from the sequencer until headers
38 // are complete. 39 // are complete.
39 sequencer()->SetBlockedUntilFlush(); 40 sequencer()->SetBlockedUntilFlush();
40 spdy_session_->RegisterStreamPriority(id, priority_); 41 spdy_session_->RegisterStreamPriority(id, priority_);
41 } 42 }
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 if (!headers_decompressed_) { 198 if (!headers_decompressed_) {
198 OnInitialHeadersComplete(fin, frame_len); 199 OnInitialHeadersComplete(fin, frame_len);
199 } else { 200 } else {
200 OnTrailingHeadersComplete(fin, frame_len); 201 OnTrailingHeadersComplete(fin, frame_len);
201 } 202 }
202 } 203 }
203 204
204 void QuicSpdyStream::OnStreamHeaderList(bool fin, 205 void QuicSpdyStream::OnStreamHeaderList(bool fin,
205 size_t frame_len, 206 size_t frame_len,
206 const QuicHeaderList& header_list) { 207 const QuicHeaderList& header_list) {
208 // The headers list avoid infinite buffering by clearing the headers list
209 // if the current headers are too large. So if the list is empty here
210 // then the headers list must have been too large, and the stream should
211 // be reset.
212 if (FLAGS_quic_limit_uncompressed_headers && header_list.empty()) {
213 OnHeadersTooLarge();
214 if (IsDoneReading()) {
215 return;
216 }
217 }
207 if (!headers_decompressed_) { 218 if (!headers_decompressed_) {
208 OnInitialHeadersComplete(fin, frame_len, header_list); 219 OnInitialHeadersComplete(fin, frame_len, header_list);
209 } else { 220 } else {
210 OnTrailingHeadersComplete(fin, frame_len, header_list); 221 OnTrailingHeadersComplete(fin, frame_len, header_list);
211 } 222 }
212 } 223 }
213 224
225 void QuicSpdyStream::OnHeadersTooLarge() {
226 Reset(QUIC_HEADERS_TOO_LARGE);
227 }
228
214 void QuicSpdyStream::OnInitialHeadersComplete(bool fin, size_t /*frame_len*/) { 229 void QuicSpdyStream::OnInitialHeadersComplete(bool fin, size_t /*frame_len*/) {
215 headers_decompressed_ = true; 230 headers_decompressed_ = true;
216 if (fin) { 231 if (fin) {
217 OnStreamFrame(QuicStreamFrame(id(), fin, 0, StringPiece())); 232 OnStreamFrame(QuicStreamFrame(id(), fin, 0, StringPiece()));
218 } 233 }
219 if (FinishedReadingHeaders()) { 234 if (FinishedReadingHeaders()) {
220 sequencer()->SetUnblocked(); 235 sequencer()->SetUnblocked();
221 } 236 }
222 } 237 }
223 238
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 if (spdy_session_->headers_stream() != nullptr && 432 if (spdy_session_->headers_stream() != nullptr &&
418 spdy_session_->force_hol_blocking()) { 433 spdy_session_->force_hol_blocking()) {
419 return spdy_session_->headers_stream()->WritevStreamData( 434 return spdy_session_->headers_stream()->WritevStreamData(
420 id(), iov, offset, fin, ack_notifier_delegate); 435 id(), iov, offset, fin, ack_notifier_delegate);
421 } 436 }
422 return ReliableQuicStream::WritevDataInner(iov, offset, fin, 437 return ReliableQuicStream::WritevDataInner(iov, offset, fin,
423 ack_notifier_delegate); 438 ack_notifier_delegate);
424 } 439 }
425 440
426 } // namespace net 441 } // namespace net
OLDNEW
« 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