forked from swift-server/swift-http-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHTTP3+ConnectionSettings.swift
More file actions
64 lines (58 loc) · 2.45 KB
/
Copy pathHTTP3+ConnectionSettings.swift
File metadata and controls
64 lines (58 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift HTTP Server open source project
//
// Copyright (c) 2026 Apple Inc. and the Swift HTTP Server project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Swift HTTP Server project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import HTTP3
@available(anyAppleOS 26.0, *)
extension NIOHTTPServerConfiguration.HTTP3 {
/// HTTP/3 connection settings sent to the peer during connection establishment.
public struct ConnectionSettings: Sendable, Hashable {
/// The maximum capacity of the QPACK dynamic table.
///
/// - SeeAlso: https://www.rfc-editor.org/rfc/rfc9204.html#section-5-2.2.1. Corresponds to
/// `SETTINGS_QPACK_MAX_TABLE_CAPACITY`.
public var qpackMaximumTableCapacity: UInt64
/// The maximum number of streams which may be blocked on QPACK at any one time.
///
/// - SeeAlso: https://www.rfc-editor.org/rfc/rfc9204.html#section-5-2.4.1. Corresponds to
/// `SETTINGS_QPACK_BLOCKED_STREAMS`.
public var qpackBlockedStreams: UInt64
/// The maximum size of a field section.
///
/// - SeeAlso: https://www.rfc-editor.org/rfc/rfc9114.html#section-7.2.4.1-2.2.1. Corresponds to
/// `SETTINGS_MAX_FIELD_SECTION_SIZE`.
public var maximumFieldSectionSize: UInt64?
/// The default HTTP/3 connection settings configuration.
///
/// Uses the following default values:
/// - `qpackMaximumTableCapacity`: 0.
/// - `qpackBlockedStreams`: 0.
/// - `maximumFieldSectionSize`: `nil` (no field section size limit).
public static var defaults: Self {
Self(
qpackMaximumTableCapacity: 0,
qpackBlockedStreams: 0,
maximumFieldSectionSize: nil
)
}
}
}
@available(anyAppleOS 26.0, *)
extension HTTP3.HTTP3Settings {
init(_ configuration: NIOHTTPServerConfiguration.HTTP3.ConnectionSettings) {
self.init(
qpackMaximumTableCapacity: configuration.qpackMaximumTableCapacity,
qpackBlockedStreams: configuration.qpackBlockedStreams,
maximumFieldSectionSize: configuration.maximumFieldSectionSize
)
}
}