blob: 8a3436cc9bc4d638261569fcb601a1608acd54a3 [file] [log] [blame]
bnc3fc60df2019-07-17 11:55:10 -07001// Copyright (c) 2019 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_HTTP_CONSTANTS_H_
6#define QUICHE_QUIC_CORE_HTTP_HTTP_CONSTANTS_H_
7
8#include <cstdint>
9
bnc63becfb2019-07-29 10:19:53 -070010#include "net/third_party/quiche/src/quic/core/quic_types.h"
11
bnc3fc60df2019-07-17 11:55:10 -070012namespace quic {
13
14// Unidirectional stream types.
15
16// https://quicwg.org/base-drafts/draft-ietf-quic-http.html#unidirectional-streams
17const uint64_t kControlStream = 0x00;
18const uint64_t kServerPushStream = 0x01;
19// https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#enc-dec-stream-def
20const uint64_t kQpackEncoderStream = 0x02;
21const uint64_t kQpackDecoderStream = 0x03;
22
renjietang241ba602020-04-29 13:29:46 -070023// This includes control stream, QPACK encoder stream, and QPACK decoder stream.
24const QuicStreamCount kHttp3StaticUnidirectionalStreamCount = 3;
25
bnc63becfb2019-07-29 10:19:53 -070026// HTTP/3 and QPACK settings identifiers.
bnc3fc60df2019-07-17 11:55:10 -070027// https://quicwg.org/base-drafts/draft-ietf-quic-http.html#settings-parameters
bnc3fc60df2019-07-17 11:55:10 -070028// https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#configuration
bnc63becfb2019-07-29 10:19:53 -070029enum Http3AndQpackSettingsIdentifiers : uint64_t {
30 // Same value as spdy::SETTINGS_HEADER_TABLE_SIZE.
31 SETTINGS_QPACK_MAX_TABLE_CAPACITY = 0x01,
32 // Same value as spdy::SETTINGS_MAX_HEADER_LIST_SIZE.
33 SETTINGS_MAX_HEADER_LIST_SIZE = 0x06,
34 SETTINGS_QPACK_BLOCKED_STREAMS = 0x07,
bnc63becfb2019-07-29 10:19:53 -070035};
36
37// Default maximum dynamic table capacity, communicated via
38// SETTINGS_QPACK_MAX_TABLE_CAPACITY.
39const QuicByteCount kDefaultQpackMaxDynamicTableCapacity = 64 * 1024; // 64 KB
bnc3fc60df2019-07-17 11:55:10 -070040
renjietang2253f4c2020-08-05 10:43:56 -070041// Default limit on the size of uncompressed headers,
42// communicated via SETTINGS_MAX_HEADER_LIST_SIZE.
43const QuicByteCount kDefaultMaxUncompressedHeaderSize = 16 * 1024; // 16 KB
44
bnc57b5f622019-08-21 14:07:44 -070045// Default limit on number of blocked streams, communicated via
46// SETTINGS_QPACK_BLOCKED_STREAMS.
47const uint64_t kDefaultMaximumBlockedStreams = 100;
48
wubbe634b72020-06-16 08:41:26 -070049const char kUserAgentHeaderName[] = "user-agent";
bnc3fc60df2019-07-17 11:55:10 -070050} // namespace quic
51
52#endif // QUICHE_QUIC_CORE_HTTP_HTTP_CONSTANTS_H_