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

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

Issue 2512623002: Add connection option kSMHL indicating supporting SETTINGS_MAX_HEADER_LIST_SIZE. SETTINGS_MAX_HEADE… (Closed)
Patch Set: Created 4 years, 1 month 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_headers_stream.h ('k') | net/quic/core/quic_headers_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_headers_stream.h" 5 #include "net/quic/core/quic_headers_stream.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 200 }
201 stream_->UpdateEnableServerPush(value > 0); 201 stream_->UpdateEnableServerPush(value > 0);
202 break; 202 break;
203 } else { 203 } else {
204 CloseConnection("Unsupported field of HTTP/2 SETTINGS frame: " + 204 CloseConnection("Unsupported field of HTTP/2 SETTINGS frame: " +
205 base::IntToString(id)); 205 base::IntToString(id));
206 } 206 }
207 break; 207 break;
208 // TODO(fayang): Need to support SETTINGS_MAX_HEADER_LIST_SIZE when 208 // TODO(fayang): Need to support SETTINGS_MAX_HEADER_LIST_SIZE when
209 // clients are actually sending it. 209 // clients are actually sending it.
210 case SETTINGS_MAX_HEADER_LIST_SIZE:
211 if (FLAGS_quic_send_max_header_list_size) {
212 break;
213 }
210 default: 214 default:
211 CloseConnection("Unsupported field of HTTP/2 SETTINGS frame: " + 215 CloseConnection("Unsupported field of HTTP/2 SETTINGS frame: " +
212 base::IntToString(id)); 216 base::IntToString(id));
213 } 217 }
214 } 218 }
215 219
216 void OnSettingsAck() override { 220 void OnSettingsAck() override {
217 if (!FLAGS_quic_respect_http2_settings_frame) { 221 if (!FLAGS_quic_respect_http2_settings_frame) {
218 CloseConnection("SPDY SETTINGS frame received."); 222 CloseConnection("SPDY SETTINGS frame received.");
219 } 223 }
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 spdy_session_->set_server_push_enabled(value); 574 spdy_session_->set_server_push_enabled(value);
571 } 575 }
572 576
573 void QuicHeadersStream::MaybeReleaseSequencerBuffer() { 577 void QuicHeadersStream::MaybeReleaseSequencerBuffer() {
574 if (FLAGS_quic_headers_stream_release_sequencer_buffer && 578 if (FLAGS_quic_headers_stream_release_sequencer_buffer &&
575 spdy_session_->ShouldReleaseHeadersStreamSequencerBuffer()) { 579 spdy_session_->ShouldReleaseHeadersStreamSequencerBuffer()) {
576 sequencer()->ReleaseBufferIfEmpty(); 580 sequencer()->ReleaseBufferIfEmpty();
577 } 581 }
578 } 582 }
579 583
584 size_t QuicHeadersStream::SendMaxHeaderListSize(size_t value) {
585 SpdySettingsIR settings_frame;
586 settings_frame.AddSetting(SETTINGS_MAX_HEADER_LIST_SIZE, false, false, value);
587
588 SpdySerializedFrame frame(spdy_framer_.SerializeFrame(settings_frame));
589 WriteOrBufferData(StringPiece(frame.data(), frame.size()), false, nullptr);
590 return frame.size();
591 }
592
580 bool QuicHeadersStream::OnDataFrameHeader(QuicStreamId stream_id, 593 bool QuicHeadersStream::OnDataFrameHeader(QuicStreamId stream_id,
581 size_t length, 594 size_t length,
582 bool fin) { 595 bool fin) {
583 if (!spdy_session_->force_hol_blocking()) { 596 if (!spdy_session_->force_hol_blocking()) {
584 return false; 597 return false;
585 } 598 }
586 if (!IsConnected()) { 599 if (!IsConnected()) {
587 return true; 600 return true;
588 } 601 }
589 DVLOG(1) << "DATA frame header for stream " << stream_id << " length " 602 DVLOG(1) << "DATA frame header for stream " << stream_id << " length "
(...skipping 16 matching lines...) Expand all
606 return true; 619 return true;
607 } 620 }
608 frame_len_ -= len; 621 frame_len_ -= len;
609 // Ignore fin_ while there is more data coming, if frame_len_ > 0. 622 // Ignore fin_ while there is more data coming, if frame_len_ > 0.
610 spdy_session_->OnStreamFrameData(stream_id, data, len, 623 spdy_session_->OnStreamFrameData(stream_id, data, len,
611 frame_len_ > 0 ? false : fin_); 624 frame_len_ > 0 ? false : fin_);
612 return true; 625 return true;
613 } 626 }
614 627
615 } // namespace net 628 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_headers_stream.h ('k') | net/quic/core/quic_headers_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698