bnc | 3fc60df | 2019-07-17 11:55:10 -0700 | [diff] [blame] | 1 | // 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 | |
bnc | 63becfb | 2019-07-29 10:19:53 -0700 | [diff] [blame] | 10 | #include "net/third_party/quiche/src/quic/core/quic_types.h" |
| 11 | |
bnc | 3fc60df | 2019-07-17 11:55:10 -0700 | [diff] [blame] | 12 | namespace quic { |
| 13 | |
| 14 | // Unidirectional stream types. |
| 15 | |
| 16 | // https://quicwg.org/base-drafts/draft-ietf-quic-http.html#unidirectional-streams |
| 17 | const uint64_t kControlStream = 0x00; |
| 18 | const uint64_t kServerPushStream = 0x01; |
| 19 | // https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#enc-dec-stream-def |
| 20 | const uint64_t kQpackEncoderStream = 0x02; |
| 21 | const uint64_t kQpackDecoderStream = 0x03; |
| 22 | |
renjietang | 241ba60 | 2020-04-29 13:29:46 -0700 | [diff] [blame] | 23 | // This includes control stream, QPACK encoder stream, and QPACK decoder stream. |
| 24 | const QuicStreamCount kHttp3StaticUnidirectionalStreamCount = 3; |
| 25 | |
bnc | 63becfb | 2019-07-29 10:19:53 -0700 | [diff] [blame] | 26 | // HTTP/3 and QPACK settings identifiers. |
bnc | 3fc60df | 2019-07-17 11:55:10 -0700 | [diff] [blame] | 27 | // https://quicwg.org/base-drafts/draft-ietf-quic-http.html#settings-parameters |
bnc | 3fc60df | 2019-07-17 11:55:10 -0700 | [diff] [blame] | 28 | // https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#configuration |
bnc | 63becfb | 2019-07-29 10:19:53 -0700 | [diff] [blame] | 29 | enum 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, |
bnc | 63becfb | 2019-07-29 10:19:53 -0700 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | // Default maximum dynamic table capacity, communicated via |
| 38 | // SETTINGS_QPACK_MAX_TABLE_CAPACITY. |
| 39 | const QuicByteCount kDefaultQpackMaxDynamicTableCapacity = 64 * 1024; // 64 KB |
bnc | 3fc60df | 2019-07-17 11:55:10 -0700 | [diff] [blame] | 40 | |
renjietang | 2253f4c | 2020-08-05 10:43:56 -0700 | [diff] [blame^] | 41 | // Default limit on the size of uncompressed headers, |
| 42 | // communicated via SETTINGS_MAX_HEADER_LIST_SIZE. |
| 43 | const QuicByteCount kDefaultMaxUncompressedHeaderSize = 16 * 1024; // 16 KB |
| 44 | |
bnc | 57b5f62 | 2019-08-21 14:07:44 -0700 | [diff] [blame] | 45 | // Default limit on number of blocked streams, communicated via |
| 46 | // SETTINGS_QPACK_BLOCKED_STREAMS. |
| 47 | const uint64_t kDefaultMaximumBlockedStreams = 100; |
| 48 | |
wub | be634b7 | 2020-06-16 08:41:26 -0700 | [diff] [blame] | 49 | const char kUserAgentHeaderName[] = "user-agent"; |
bnc | 3fc60df | 2019-07-17 11:55:10 -0700 | [diff] [blame] | 50 | } // namespace quic |
| 51 | |
| 52 | #endif // QUICHE_QUIC_CORE_HTTP_HTTP_CONSTANTS_H_ |