You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and wire-format handling for HTTP/1.x, HTTP/2, and HTTP/3
6
6
tags:
7
7
- architecture
8
8
- protocol
@@ -15,7 +15,7 @@ tags:
15
15
16
16
## Purpose
17
17
18
-
The Protocol layer (`src/TurboHttp/Protocol/`) implements wire-format encoding and decoding for all supported HTTP versions. Each RFC gets its own subfolder containing encoders, decoders, and version-specific business logic. Shared compression codecs (HPACK, QPACK, Huffman) live in dedicated RFC subfolders and are consumed by multiple protocol versions.
18
+
The Protocol layer (`src/TurboHttp/Protocol/`) implements wire-format encoding and decoding for all supported HTTP versions. Each HTTP version and cross-cutting concern gets its own component subfolder containing encoders, decoders, and version-specific business logic. Shared codecs (HPACK under `Http2/Hpack/`, QPACK under `Http3/Qpack/`, Huffman at the root) are consumed by multiple protocol versions.
19
19
20
20
This layer sits **below** the Streams layer (which orchestrates stage graphs) and **above** the Transport layer (which moves raw bytes). Protocol types convert between `HttpRequestMessage`/`HttpResponseMessage` and the `IOutputItem`/`IInputItem` message protocol used by the pipeline.
21
21
@@ -27,24 +27,25 @@ This layer sits **below** the Streams layer (which orchestrates stage graphs) an
27
27
28
28
| Component | Path | Role |
29
29
|-----------|------|------|
30
-
| HTTP/1.1 Encoder |`Protocol/RFC9112/Http11Encoder.cs`| Serialises requests to HTTP/1.1 wire format |
- Encoders: `Http{version}Encoder.cs` — one per wire-format version
219
264
- Decoders: `Http{version}Decoder.cs` — paired with encoder
220
-
-RFC subfolder name matches the RFC number (e.g., `RFC9113/` for HTTP/2)
265
+
-Component subfolder name matches the protocol version (e.g., `Http2/` for HTTP/2, `Semantics/` for cross-cutting concerns)
221
266
222
267
---
223
268
224
269
## Design Decisions
225
270
226
-
1.**RFC-per-folder organisation** — Each RFC gets its own namespace and folder, making compliance tracking straightforward. Cross-cutting concerns (Huffman, shared types) live in the lowest-numbered RFC that defines them.
271
+
1.**Component-per-folder organisation** — Each HTTP version and cross-cutting concern gets its own component subfolder, making compliance tracking straightforward. Shared codecs (HPACK under `Http2/Hpack/`, QPACK under `Http3/Qpack/`, Huffman at the root) are nested under their primary consumer.
227
272
228
273
2.**Stateless encoders, stateful decoders** — Encoders are largely stateless (HPACK/QPACK state is injected). Decoders maintain parsing state machines because responses can arrive incrementally across multiple `IInputItem` deliveries.
0 commit comments