blob: 9f7349f5effc870c908af04aaf94b50c6a85ab57 [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// Copyright (c) 2015 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef QUICHE_QUIC_CORE_HTTP_QUIC_SPDY_SESSION_H_
6#define QUICHE_QUIC_CORE_HTTP_QUIC_SPDY_SESSION_H_
7
8#include <cstddef>
9#include <memory>
vasilvv872e7a32019-03-12 16:42:44 -070010#include <string>
QUICHE teama6ef0a62019-03-07 20:34:33 -050011
renjietanga6d47372019-09-27 14:17:56 -070012#include "net/third_party/quiche/src/quic/core/http/http_frames.h"
QUICHE teama6ef0a62019-03-07 20:34:33 -050013#include "net/third_party/quiche/src/quic/core/http/quic_header_list.h"
14#include "net/third_party/quiche/src/quic/core/http/quic_headers_stream.h"
renjietang3a1bb802019-06-11 10:42:41 -070015#include "net/third_party/quiche/src/quic/core/http/quic_receive_control_stream.h"
16#include "net/third_party/quiche/src/quic/core/http/quic_send_control_stream.h"
QUICHE teama6ef0a62019-03-07 20:34:33 -050017#include "net/third_party/quiche/src/quic/core/http/quic_spdy_stream.h"
18#include "net/third_party/quiche/src/quic/core/qpack/qpack_decoder.h"
19#include "net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_sender.h"
20#include "net/third_party/quiche/src/quic/core/qpack/qpack_encoder.h"
21#include "net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender.h"
renjietang87cd7de2019-08-16 08:35:10 -070022#include "net/third_party/quiche/src/quic/core/qpack/qpack_receive_stream.h"
23#include "net/third_party/quiche/src/quic/core/qpack/qpack_send_stream.h"
QUICHE teama6ef0a62019-03-07 20:34:33 -050024#include "net/third_party/quiche/src/quic/core/quic_session.h"
25#include "net/third_party/quiche/src/quic/core/quic_versions.h"
26#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
dmcardleba2fb7e2019-12-13 07:44:34 -080027#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
QUICHE teama6ef0a62019-03-07 20:34:33 -050028#include "net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h"
29
30namespace quic {
31
32namespace test {
33class QuicSpdySessionPeer;
34} // namespace test
35
36// QuicHpackDebugVisitor gathers data used for understanding HPACK HoL
37// dynamics. Specifically, it is to help predict the compression
38// penalty of avoiding HoL by chagning how the dynamic table is used.
39// In chromium, the concrete instance populates an UMA
40// histogram with the data.
41class QUIC_EXPORT_PRIVATE QuicHpackDebugVisitor {
42 public:
43 QuicHpackDebugVisitor();
44 QuicHpackDebugVisitor(const QuicHpackDebugVisitor&) = delete;
45 QuicHpackDebugVisitor& operator=(const QuicHpackDebugVisitor&) = delete;
46
47 virtual ~QuicHpackDebugVisitor();
48
49 // For each HPACK indexed representation processed, |elapsed| is
50 // the time since the corresponding entry was added to the dynamic
51 // table.
52 virtual void OnUseEntry(QuicTime::Delta elapsed) = 0;
53};
54
renjietangaaf85e42019-09-17 10:29:50 -070055class QUIC_EXPORT_PRIVATE Http3DebugVisitor {
56 public:
57 Http3DebugVisitor();
58 Http3DebugVisitor(const Http3DebugVisitor&) = delete;
59 Http3DebugVisitor& operator=(const Http3DebugVisitor&) = delete;
60
61 virtual ~Http3DebugVisitor();
62
63 // Called when peer's control stream type is received.
64 virtual void OnPeerControlStreamCreated(QuicStreamId /*stream_id*/) = 0;
65
66 // Called when peer's QPACK encoder stream type is received.
67 virtual void OnPeerQpackEncoderStreamCreated(QuicStreamId /*stream_id*/) = 0;
68
69 // Called when peer's QPACK decoder stream type is received.
70 virtual void OnPeerQpackDecoderStreamCreated(QuicStreamId /*stream_id*/) = 0;
71
72 // Called when SETTINGS frame is received.
renjietanga6d47372019-09-27 14:17:56 -070073 virtual void OnSettingsFrameReceived(const SettingsFrame& /*frame*/) = 0;
74
75 // Called when SETTINGS frame is sent.
76 virtual void OnSettingsFrameSent(const SettingsFrame& /*frame*/) = 0;
renjietangaaf85e42019-09-17 10:29:50 -070077};
78
renjietang69a8eaf2019-08-06 15:55:58 -070079// A QUIC session for HTTP.
QUICHE teama6ef0a62019-03-07 20:34:33 -050080class QUIC_EXPORT_PRIVATE QuicSpdySession
81 : public QuicSession,
82 public QpackEncoder::DecoderStreamErrorDelegate,
renjietangc2aa5cb2019-06-20 12:22:53 -070083 public QpackDecoder::EncoderStreamErrorDelegate {
QUICHE teama6ef0a62019-03-07 20:34:33 -050084 public:
85 // Does not take ownership of |connection| or |visitor|.
86 QuicSpdySession(QuicConnection* connection,
87 QuicSession::Visitor* visitor,
88 const QuicConfig& config,
89 const ParsedQuicVersionVector& supported_versions);
90 QuicSpdySession(const QuicSpdySession&) = delete;
91 QuicSpdySession& operator=(const QuicSpdySession&) = delete;
92
93 ~QuicSpdySession() override;
94
95 void Initialize() override;
96
97 // QpackEncoder::DecoderStreamErrorDelegate implementation.
dmcardleba2fb7e2019-12-13 07:44:34 -080098 void OnDecoderStreamError(quiche::QuicheStringPiece error_message) override;
QUICHE teama6ef0a62019-03-07 20:34:33 -050099
QUICHE teama6ef0a62019-03-07 20:34:33 -0500100 // QpackDecoder::EncoderStreamErrorDelegate implementation.
dmcardleba2fb7e2019-12-13 07:44:34 -0800101 void OnEncoderStreamError(quiche::QuicheStringPiece error_message) override;
QUICHE teama6ef0a62019-03-07 20:34:33 -0500102
QUICHE teama6ef0a62019-03-07 20:34:33 -0500103 // Called by |headers_stream_| when headers with a priority have been
104 // received for a stream. This method will only be called for server streams.
fayang476683a2019-07-25 12:42:16 -0700105 virtual void OnStreamHeadersPriority(
106 QuicStreamId stream_id,
107 const spdy::SpdyStreamPrecedence& precedence);
QUICHE teama6ef0a62019-03-07 20:34:33 -0500108
109 // Called by |headers_stream_| when headers have been completely received
110 // for a stream. |fin| will be true if the fin flag was set in the headers
111 // frame.
112 virtual void OnStreamHeaderList(QuicStreamId stream_id,
113 bool fin,
114 size_t frame_len,
115 const QuicHeaderList& header_list);
116
117 // Called by |headers_stream_| when push promise headers have been
118 // completely received. |fin| will be true if the fin flag was set
119 // in the headers.
120 virtual void OnPromiseHeaderList(QuicStreamId stream_id,
121 QuicStreamId promised_stream_id,
122 size_t frame_len,
123 const QuicHeaderList& header_list);
124
125 // Called by |headers_stream_| when a PRIORITY frame has been received for a
126 // stream. This method will only be called for server streams.
127 virtual void OnPriorityFrame(QuicStreamId stream_id,
fayang476683a2019-07-25 12:42:16 -0700128 const spdy::SpdyStreamPrecedence& precedence);
QUICHE teama6ef0a62019-03-07 20:34:33 -0500129
130 // Sends contents of |iov| to h2_deframer_, returns number of bytes processed.
131 size_t ProcessHeaderData(const struct iovec& iov);
132
133 // Writes |headers| for the stream |id| to the dedicated headers stream.
134 // If |fin| is true, then no more data will be sent for the stream |id|.
135 // If provided, |ack_notifier_delegate| will be registered to be notified when
136 // we have seen ACKs for all packets resulting from this call.
137 virtual size_t WriteHeadersOnHeadersStream(
138 QuicStreamId id,
139 spdy::SpdyHeaderBlock headers,
140 bool fin,
fayang476683a2019-07-25 12:42:16 -0700141 const spdy::SpdyStreamPrecedence& precedence,
QUICHE teama6ef0a62019-03-07 20:34:33 -0500142 QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener);
143
bnccd3c4b52020-01-10 11:13:18 -0800144 // Writes an HTTP/2 PRIORITY frame the to peer. Returns the size in bytes of
145 // the resulting PRIORITY frame for QUIC_VERSION_43 and above. Otherwise, does
QUICHE teama6ef0a62019-03-07 20:34:33 -0500146 // nothing and returns 0.
147 size_t WritePriority(QuicStreamId id,
148 QuicStreamId parent_stream_id,
149 int weight,
150 bool exclusive);
151
bnccd3c4b52020-01-10 11:13:18 -0800152 // Writes an HTTP/3 PRIORITY_UPDATE frame to the peer.
153 void WriteHttp3PriorityUpdate(const PriorityUpdateFrame& priority_update);
154
renjietang686ce582019-10-17 14:28:16 -0700155 // Process received HTTP/3 GOAWAY frame. This method should only be called on
156 // the client side.
157 virtual void OnHttp3GoAway(QuicStreamId stream_id);
158
159 // Write the GOAWAY |frame| on control stream.
160 void SendHttp3GoAway();
161
QUICHE teama6ef0a62019-03-07 20:34:33 -0500162 // Write |headers| for |promised_stream_id| on |original_stream_id| in a
163 // PUSH_PROMISE frame to peer.
renjietangf4f47122019-07-22 12:08:53 -0700164 virtual void WritePushPromise(QuicStreamId original_stream_id,
165 QuicStreamId promised_stream_id,
166 spdy::SpdyHeaderBlock headers);
QUICHE teama6ef0a62019-03-07 20:34:33 -0500167
QUICHE teama6ef0a62019-03-07 20:34:33 -0500168 QpackEncoder* qpack_encoder();
169 QpackDecoder* qpack_decoder();
renjietang9818f8c2019-07-16 11:12:27 -0700170 QuicHeadersStream* headers_stream() { return headers_stream_; }
renjietangfbeb5bf2019-04-19 15:06:20 -0700171
renjietang9818f8c2019-07-16 11:12:27 -0700172 const QuicHeadersStream* headers_stream() const { return headers_stream_; }
QUICHE teama6ef0a62019-03-07 20:34:33 -0500173
174 bool server_push_enabled() const { return server_push_enabled_; }
175
bnc5b182b92019-07-30 11:00:15 -0700176 // Called when a setting is parsed from an incoming SETTINGS frame.
177 void OnSetting(uint64_t id, uint64_t value);
QUICHE teama6ef0a62019-03-07 20:34:33 -0500178
179 // Return true if this session wants to release headers stream's buffer
180 // aggressively.
181 virtual bool ShouldReleaseHeadersStreamSequencerBuffer();
182
183 void CloseConnectionWithDetails(QuicErrorCode error,
vasilvvc48c8712019-03-11 13:38:16 -0700184 const std::string& details);
QUICHE teama6ef0a62019-03-07 20:34:33 -0500185
bnc5597f292019-08-23 07:09:25 -0700186 // Must not be called after Initialize().
187 // TODO(bnc): Move to constructor argument.
188 void set_qpack_maximum_dynamic_table_capacity(
189 uint64_t qpack_maximum_dynamic_table_capacity) {
190 qpack_maximum_dynamic_table_capacity_ =
191 qpack_maximum_dynamic_table_capacity;
192 }
193
194 // Must not be called after Initialize().
195 // TODO(bnc): Move to constructor argument.
196 void set_qpack_maximum_blocked_streams(
197 uint64_t qpack_maximum_blocked_streams) {
198 qpack_maximum_blocked_streams_ = qpack_maximum_blocked_streams;
199 }
200
201 // Must not be called after Initialize().
bnc30d610c2019-07-08 18:39:59 -0700202 // TODO(bnc): Move to constructor argument.
QUICHE teama6ef0a62019-03-07 20:34:33 -0500203 void set_max_inbound_header_list_size(size_t max_inbound_header_list_size) {
204 max_inbound_header_list_size_ = max_inbound_header_list_size;
205 }
206
renjietang3a1bb802019-06-11 10:42:41 -0700207 size_t max_outbound_header_list_size() const {
208 return max_outbound_header_list_size_;
209 }
210
renjietangfee2cc32019-04-05 11:32:07 -0700211 size_t max_inbound_header_list_size() const {
212 return max_inbound_header_list_size_;
213 }
214
QUICHE teamc2653c42019-03-08 13:30:06 -0800215 // Returns true if the session has active request streams.
216 bool HasActiveRequestStreams() const;
217
renjietang3c3dfb72019-07-26 11:55:52 -0700218 // Called when the size of the compressed frame payload is available.
219 void OnCompressedFrameSize(size_t frame_len);
220
221 // Called when a PUSH_PROMISE frame has been received.
222 void OnPushPromise(spdy::SpdyStreamId stream_id,
223 spdy::SpdyStreamId promised_stream_id);
224
225 // Called when the complete list of headers is available.
226 void OnHeaderList(const QuicHeaderList& header_list);
227
228 QuicStreamId promised_stream_id() const { return promised_stream_id_; }
229
renjietangc04c85f2019-07-25 14:07:27 -0700230 // Initialze HTTP/3 unidirectional streams if |unidirectional| is true and
231 // those streams are not initialized yet.
232 void OnCanCreateNewOutgoingStream(bool unidirectional) override;
233
rch63172212019-10-15 11:38:28 -0700234 void SetMaxAllowedPushId(QuicStreamId max_allowed_push_id);
QUICHE teamc258e4f2019-08-14 10:04:58 -0700235
236 QuicStreamId max_allowed_push_id() { return max_allowed_push_id_; }
237
fayangeae1ea82019-08-20 13:21:19 -0700238 int32_t destruction_indicator() const { return destruction_indicator_; }
239
renjietangaaf85e42019-09-17 10:29:50 -0700240 void set_debug_visitor(Http3DebugVisitor* debug_visitor) {
241 debug_visitor_ = debug_visitor;
242 }
243
244 Http3DebugVisitor* debug_visitor() { return debug_visitor_; }
245
renjietang686ce582019-10-17 14:28:16 -0700246 bool http3_goaway_received() const { return http3_goaway_received_; }
247
248 bool http3_goaway_sent() const { return http3_goaway_sent_; }
249
bnc20a9ad92019-10-01 10:29:14 -0700250 // Log header compression ratio histogram.
251 // |using_qpack| is true for QPACK, false for HPACK.
252 // |is_sent| is true for sent headers, false for received ones.
253 // Ratio is recorded as percentage. Smaller value means more efficient
254 // compression. Compressed size might be larger than uncompressed size, but
255 // recorded ratio is trunckated at 200%.
256 // Uncompressed size can be zero for an empty header list, and compressed size
257 // can be zero for an empty header list when using HPACK. (QPACK always emits
258 // a header block prefix of at least two bytes.) This method records nothing
259 // if either |compressed| or |uncompressed| is not positive.
260 // In order for measurements for different protocol to be comparable, the
261 // caller must ensure that uncompressed size is the total length of header
262 // names and values without any overhead.
263 static void LogHeaderCompressionRatioHistogram(bool using_qpack,
264 bool is_sent,
265 QuicByteCount compressed,
266 QuicByteCount uncompressed);
267
bnc20df1af2019-11-12 10:46:20 -0800268 // True if any dynamic table entries have been referenced from either a sent
269 // or received header block. Used for stats.
270 bool dynamic_table_entry_referenced() const {
271 return (qpack_encoder_ &&
272 qpack_encoder_->dynamic_table_entry_referenced()) ||
273 (qpack_decoder_ && qpack_decoder_->dynamic_table_entry_referenced());
274 }
275
QUICHE teama6ef0a62019-03-07 20:34:33 -0500276 protected:
277 // Override CreateIncomingStream(), CreateOutgoingBidirectionalStream() and
278 // CreateOutgoingUnidirectionalStream() with QuicSpdyStream return type to
279 // make sure that all data streams are QuicSpdyStreams.
280 QuicSpdyStream* CreateIncomingStream(QuicStreamId id) override = 0;
renjietangbaea59c2019-05-29 15:08:14 -0700281 QuicSpdyStream* CreateIncomingStream(PendingStream* pending) override = 0;
QUICHE teama6ef0a62019-03-07 20:34:33 -0500282 virtual QuicSpdyStream* CreateOutgoingBidirectionalStream() = 0;
283 virtual QuicSpdyStream* CreateOutgoingUnidirectionalStream() = 0;
284
renjietang59dc7702019-12-10 15:40:02 -0800285 QuicSpdyStream* GetOrCreateSpdyDataStream(const QuicStreamId stream_id);
QUICHE teama6ef0a62019-03-07 20:34:33 -0500286
287 // If an incoming stream can be created, return true.
288 virtual bool ShouldCreateIncomingStream(QuicStreamId id) = 0;
289
290 // If an outgoing bidirectional/unidirectional stream can be created, return
291 // true.
292 virtual bool ShouldCreateOutgoingBidirectionalStream() = 0;
293 virtual bool ShouldCreateOutgoingUnidirectionalStream() = 0;
294
295 // Returns true if there are open HTTP requests.
296 bool ShouldKeepConnectionAlive() const override;
297
renjietange76b2da2019-05-13 14:50:23 -0700298 // Overridden to buffer incoming unidirectional streams for version 99.
299 bool UsesPendingStreams() const override;
QUICHE teama6ef0a62019-03-07 20:34:33 -0500300
renjietangbb1c4892019-05-24 15:58:44 -0700301 // Overridden to Process HTTP/3 stream types. H/3 streams will be created from
302 // pending streams accordingly if the stream type can be read. Returns true if
303 // unidirectional streams are created.
304 bool ProcessPendingStream(PendingStream* pending) override;
renjietang0c558862019-05-08 13:26:23 -0700305
QUICHE teama6ef0a62019-03-07 20:34:33 -0500306 size_t WriteHeadersOnHeadersStreamImpl(
307 QuicStreamId id,
308 spdy::SpdyHeaderBlock headers,
309 bool fin,
310 QuicStreamId parent_stream_id,
311 int weight,
312 bool exclusive,
313 QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener);
314
315 void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override;
fayangd58736d2019-11-27 13:35:31 -0800316 void SetDefaultEncryptionLevel(quic::EncryptionLevel level) override;
QUICHE teama6ef0a62019-03-07 20:34:33 -0500317
318 bool supports_push_promise() { return supports_push_promise_; }
319
320 // Optional, enables instrumentation related to go/quic-hpack.
321 void SetHpackEncoderDebugVisitor(
322 std::unique_ptr<QuicHpackDebugVisitor> visitor);
323 void SetHpackDecoderDebugVisitor(
324 std::unique_ptr<QuicHpackDebugVisitor> visitor);
325
326 // Sets the maximum size of the header compression table spdy_framer_ is
327 // willing to use to encode header blocks.
328 void UpdateHeaderEncoderTableSize(uint32_t value);
329
330 // Called when SETTINGS_ENABLE_PUSH is received, only supported on
331 // server side.
332 void UpdateEnableServerPush(bool value);
333
334 bool IsConnected() { return connection()->connected(); }
335
renjietang118c8ac2019-07-30 11:43:59 -0700336 const QuicReceiveControlStream* receive_control_stream() const {
337 return receive_control_stream_;
338 }
339
renjietang1a33a0c2019-08-12 12:05:31 -0700340 // Initializes HTTP/3 unidirectional streams if not yet initialzed.
341 virtual void MaybeInitializeHttp3UnidirectionalStreams();
342
QUICHE teamc258e4f2019-08-14 10:04:58 -0700343 void set_max_uncompressed_header_bytes(
344 size_t set_max_uncompressed_header_bytes);
345
rch63172212019-10-15 11:38:28 -0700346 void SendMaxPushId();
QUICHE teamc258e4f2019-08-14 10:04:58 -0700347
QUICHE teama6ef0a62019-03-07 20:34:33 -0500348 private:
349 friend class test::QuicSpdySessionPeer;
350
351 class SpdyFramerVisitor;
352
353 // The following methods are called by the SimpleVisitor.
354
355 // Called when a HEADERS frame has been received.
356 void OnHeaders(spdy::SpdyStreamId stream_id,
357 bool has_priority,
fayang476683a2019-07-25 12:42:16 -0700358 const spdy::SpdyStreamPrecedence& precedence,
QUICHE teama6ef0a62019-03-07 20:34:33 -0500359 bool fin);
360
QUICHE teama6ef0a62019-03-07 20:34:33 -0500361 // Called when a PRIORITY frame has been received.
fayang476683a2019-07-25 12:42:16 -0700362 void OnPriority(spdy::SpdyStreamId stream_id,
363 const spdy::SpdyStreamPrecedence& precedence);
QUICHE teama6ef0a62019-03-07 20:34:33 -0500364
renjietang309b7fb2019-08-21 12:26:26 -0700365 void CloseConnectionOnDuplicateHttp3UnidirectionalStreams(
dmcardleba2fb7e2019-12-13 07:44:34 -0800366 quiche::QuicheStringPiece type);
renjietang309b7fb2019-08-21 12:26:26 -0700367
rch5f22abc2019-10-11 16:25:12 -0700368 // Sends any data which should be sent at the start of a connection,
369 // including the initial SETTINGS frame, etc.
370 void SendInitialData();
371
QUICHE teama6ef0a62019-03-07 20:34:33 -0500372 std::unique_ptr<QpackEncoder> qpack_encoder_;
373 std::unique_ptr<QpackDecoder> qpack_decoder_;
374
renjietang9818f8c2019-07-16 11:12:27 -0700375 // Pointer to the header stream in stream_map_.
376 QuicHeadersStream* headers_stream_;
renjietangfbeb5bf2019-04-19 15:06:20 -0700377
renjietang87cd7de2019-08-16 08:35:10 -0700378 // HTTP/3 control streams. They are owned by QuicSession inside
renjietang3a1bb802019-06-11 10:42:41 -0700379 // stream map, and can be accessed by those unowned pointers below.
380 QuicSendControlStream* send_control_stream_;
381 QuicReceiveControlStream* receive_control_stream_;
382
renjietang87cd7de2019-08-16 08:35:10 -0700383 // Pointers to HTTP/3 QPACK streams in stream map.
384 QpackReceiveStream* qpack_encoder_receive_stream_;
385 QpackReceiveStream* qpack_decoder_receive_stream_;
386 QpackSendStream* qpack_encoder_send_stream_;
387 QpackSendStream* qpack_decoder_send_stream_;
388
bnc5597f292019-08-23 07:09:25 -0700389 // Maximum dynamic table capacity as defined at
390 // https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#maximum-dynamic-table-capacity
391 // for the decoding context. Value will be sent via
392 // SETTINGS_QPACK_MAX_TABLE_CAPACITY.
bncb9cf4c72019-09-12 14:46:01 -0700393 // |qpack_maximum_dynamic_table_capacity_| also serves as an upper bound for
394 // the dynamic table capacity of the encoding context, to limit memory usage
395 // if a larger SETTINGS_QPACK_MAX_TABLE_CAPACITY value is received.
bnc5597f292019-08-23 07:09:25 -0700396 uint64_t qpack_maximum_dynamic_table_capacity_;
397
398 // Maximum number of blocked streams as defined at
399 // https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#blocked-streams
400 // for the decoding context. Value will be sent via
401 // SETTINGS_QPACK_BLOCKED_STREAMS.
402 uint64_t qpack_maximum_blocked_streams_;
403
QUICHE teama6ef0a62019-03-07 20:34:33 -0500404 // The maximum size of a header block that will be accepted from the peer,
405 // defined per spec as key + value + overhead per field (uncompressed).
bnc5597f292019-08-23 07:09:25 -0700406 // Value will be sent via SETTINGS_MAX_HEADER_LIST_SIZE.
QUICHE teama6ef0a62019-03-07 20:34:33 -0500407 size_t max_inbound_header_list_size_;
408
renjietang3a1bb802019-06-11 10:42:41 -0700409 // The maximum size of a header block that can be sent to the peer. This field
410 // is informed and set by the peer via SETTINGS frame.
411 // TODO(renjietang): Honor this field when sending headers.
412 size_t max_outbound_header_list_size_;
413
QUICHE teama6ef0a62019-03-07 20:34:33 -0500414 // Set during handshake. If true, resources in x-associated-content and link
415 // headers will be pushed.
416 bool server_push_enabled_;
417
418 // Data about the stream whose headers are being processed.
419 QuicStreamId stream_id_;
420 QuicStreamId promised_stream_id_;
421 bool fin_;
422 size_t frame_len_;
QUICHE teama6ef0a62019-03-07 20:34:33 -0500423
424 bool supports_push_promise_;
425
426 spdy::SpdyFramer spdy_framer_;
427 http2::Http2DecoderAdapter h2_deframer_;
428 std::unique_ptr<SpdyFramerVisitor> spdy_framer_visitor_;
QUICHE teamc258e4f2019-08-14 10:04:58 -0700429 QuicStreamId max_allowed_push_id_;
fayangeae1ea82019-08-20 13:21:19 -0700430
431 // An integer used for live check. The indicator is assigned a value in
432 // constructor. As long as it is not the assigned value, that would indicate
433 // an use-after-free.
434 int32_t destruction_indicator_;
renjietangaaf85e42019-09-17 10:29:50 -0700435
436 // Not owned by the session.
437 Http3DebugVisitor* debug_visitor_;
renjietang686ce582019-10-17 14:28:16 -0700438
439 // If the endpoint has received HTTP/3 GOAWAY frame.
440 bool http3_goaway_received_;
441 // If the endpoint has sent HTTP/3 GOAWAY frame.
442 bool http3_goaway_sent_;
rch4cd745d2019-12-03 13:19:41 -0800443
renjietang59dc7702019-12-10 15:40:02 -0800444 // If the endpoint has sent the initial HTTP/3 MAX_PUSH_ID frame.
rch4cd745d2019-12-03 13:19:41 -0800445 bool http3_max_push_id_sent_;
QUICHE teama6ef0a62019-03-07 20:34:33 -0500446};
447
448} // namespace quic
449
450#endif // QUICHE_QUIC_CORE_HTTP_QUIC_SPDY_SESSION_H_