diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-02-04 17:20:24 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-02-12 08:15:25 +0000 |
commit | 8fa0776f1f79e91fc9c0b9c1ba11a0a29c05196b (patch) | |
tree | 788d8d7549712682703a0310ca4a0f0860d4802b /chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.cc | |
parent | 606d85f2a5386472314d39923da28c70c60dc8e7 (diff) | |
download | qtwebengine-chromium-8fa0776f1f79e91fc9c0b9c1ba11a0a29c05196b.tar.gz |
BASELINE: Update Chromium to 98.0.4758.90
Change-Id: Ib7c41539bf8a8e0376bd639f27d68294de90f3c8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.cc')
-rw-r--r-- | chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.cc | 56 |
1 files changed, 51 insertions, 5 deletions
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.cc index 0cd2644abcb..5a859271e6e 100644 --- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.cc +++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.cc @@ -453,7 +453,11 @@ QuicSpdySession::QuicSpdySession( spdy_framer_(SpdyFramer::ENABLE_COMPRESSION), spdy_framer_visitor_(new SpdyFramerVisitor(this)), debug_visitor_(nullptr), - destruction_indicator_(123456789) { + destruction_indicator_(123456789), + allow_extended_connect_( + GetQuicReloadableFlag(quic_verify_request_headers_2) && + perspective() == Perspective::IS_SERVER && + VersionUsesHttp3(transport_version())) { h2_deframer_.set_visitor(spdy_framer_visitor_.get()); h2_deframer_.set_debug_visitor(spdy_framer_visitor_.get()); spdy_framer_.set_debug_visitor(spdy_framer_visitor_.get()); @@ -522,6 +526,10 @@ void QuicSpdySession::FillSettingsFrame() { if (WillNegotiateWebTransport()) { settings_.values[SETTINGS_WEBTRANS_DRAFT00] = 1; } + if (allow_extended_connect()) { + QUIC_RELOADABLE_FLAG_COUNT_N(quic_verify_request_headers_2, 1, 3); + settings_.values[SETTINGS_ENABLE_CONNECT_PROTOCOL] = 1; + } } void QuicSpdySession::OnDecoderStreamError(QuicErrorCode error_code, @@ -867,6 +875,10 @@ void QuicSpdySession::OnNewEncryptionKeyAvailable( bool QuicSpdySession::ShouldNegotiateWebTransport() { return false; } +bool QuicSpdySession::ShouldNegotiateDatagramContexts() { return false; } + +bool QuicSpdySession::ShouldValidateWebTransportVersion() const { return true; } + bool QuicSpdySession::WillNegotiateWebTransport() { return LocalHttpDatagramSupport() != HttpDatagramSupport::kNone && version().UsesHttp3() && ShouldNegotiateWebTransport(); @@ -1034,9 +1046,7 @@ bool QuicSpdySession::VerifySettingIsZeroOrOne(uint64_t id, uint64_t value) { H3SettingsToString(static_cast<Http3AndQpackSettingsIdentifiers>(id)), " with invalid value ", value); QUIC_PEER_BUG(bad received setting) << ENDPOINT << error_details; - // TODO(dschinazi) use QUIC_HTTP_INVALID_SETTING_VALUE instead of - // QUIC_HTTP_RECEIVE_SPDY_SETTING once cl/396439351 lands. - CloseConnectionWithDetails(QUIC_HTTP_RECEIVE_SPDY_SETTING, error_details); + CloseConnectionWithDetails(QUIC_HTTP_INVALID_SETTING_VALUE, error_details); return false; } @@ -1112,6 +1122,18 @@ bool QuicSpdySession::OnSetting(uint64_t id, uint64_t value) { } break; } + case SETTINGS_ENABLE_CONNECT_PROTOCOL: { + QUIC_DVLOG(1) << ENDPOINT + << "SETTINGS_ENABLE_CONNECT_PROTOCOL received with value " + << value; + if (!VerifySettingIsZeroOrOne(id, value)) { + return false; + } + if (perspective() == Perspective::IS_CLIENT) { + allow_extended_connect_ = value != 0; + } + break; + } case spdy::SETTINGS_ENABLE_PUSH: ABSL_FALLTHROUGH_INTENDED; case spdy::SETTINGS_MAX_CONCURRENT_STREAMS: @@ -1178,6 +1200,9 @@ bool QuicSpdySession::OnSetting(uint64_t id, uint64_t value) { return false; } peer_supports_webtransport_ = (value == 1); + if (perspective() == Perspective::IS_CLIENT && value == 1) { + allow_extended_connect_ = true; + } break; default: QUIC_DVLOG(1) << ENDPOINT << "Unknown setting identifier " << id @@ -1735,7 +1760,9 @@ void QuicSpdySession::OnMessageReceived(absl::string_view message) { bool QuicSpdySession::SupportsWebTransport() { return WillNegotiateWebTransport() && SupportsH3Datagram() && - peer_supports_webtransport_; + peer_supports_webtransport_ && + (!GetQuicReloadableFlag(quic_verify_request_headers_2) || + allow_extended_connect_); } bool QuicSpdySession::SupportsH3Datagram() const { @@ -1893,6 +1920,25 @@ std::ostream& operator<<(std::ostream& os, return os; } +// Must not be called after Initialize(). +void QuicSpdySession::set_allow_extended_connect(bool allow_extended_connect) { + QUIC_BUG_IF(extended connect wrong version, + !GetQuicReloadableFlag(quic_verify_request_headers_2) || + !VersionUsesHttp3(transport_version())) + << "Try to enable/disable extended CONNECT in Google QUIC"; + QUIC_BUG_IF(extended connect on client, + !GetQuicReloadableFlag(quic_verify_request_headers_2) || + perspective() == Perspective::IS_CLIENT) + << "Enabling/disabling extended CONNECT on the client side has no effect"; + if (ShouldNegotiateWebTransport()) { + QUIC_BUG_IF(disable extended connect, !allow_extended_connect) + << "Disabling extended CONNECT with web transport enabled has no " + "effect."; + return; + } + allow_extended_connect_ = allow_extended_connect; +} + #undef ENDPOINT // undef for jumbo builds } // namespace quic |