Commit f70d902
committed
feat(quic,http): implement QUIC FIN signaling, HTTP/1 body limit, and review fixes
QUIC FIN layer:
- Add NGTCP2_WRITE_STREAM_FLAG_FIN/MORE constants and flags parameter
to conn_writev_stream
- Register recv_stream_data and stream_close ngtcp2 callbacks with
FIN detection and overflow-safe event buffering
- Add send_fin(), send_with_fin(), send_with_flags() methods
- Add drain_stream_events() with error propagation on overflow
- Add ensure_stream(), stream_has_fin(), stream_exists() abstraction API
- Auto-create stream entries for FIN events on unknown streams
HTTP/3 FIN integration:
- Replace non-standard empty DATA frame end-marker with proper QUIC
FIN signaling per RFC 9114 §4.1
- Client sends FIN after last frame via send_frame_with_fin()
- Server detects request completion via check_fin_completions() sweep
after frame processing, handling separate-packet FIN and empty-body
POST/PUT/PATCH
- Server coalesces response FIN with last data write
- Per-connection packet_mu mutex serializing QUIC state mutations
- Split process_packet_frames into ingest/decode/dispatch helpers
HTTP/1 hardening:
- Add max_request_body_size (10MB default) to Server struct matching
HTTP/2 and HTTP/3 defaults
- Add parse_request_with_limit() checking Content-Length before allocation
- Strict Content-Length validation rejecting negative, non-numeric, and
overflow values via validate_and_parse_content_length()
- Detect truncated request bodies (unexpected EOF)
- Backward-compatible Handler interface with ServerHandler adapter1 parent ede3439 commit f70d902
56 files changed
Lines changed: 3873 additions & 2331 deletions
File tree
- examples
- http2
- http3
- vlib/net
- http
- common
- v2
- v3
- quic
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
4 | 12 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 13 | + | |
19 | 14 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 15 | + | |
27 | 16 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 17 | + | |
| 18 | + | |
31 | 19 | | |
32 | | - | |
33 | 20 | | |
34 | 21 | | |
35 | | - | |
| 22 | + | |
36 | 23 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
40 | 27 | | |
41 | 28 | | |
42 | 29 | | |
43 | 30 | | |
44 | | - | |
| 31 | + | |
45 | 32 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
49 | 36 | | |
50 | 37 | | |
51 | 38 | | |
52 | 39 | | |
53 | | - | |
| 40 | + | |
54 | 41 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
59 | 46 | | |
60 | 47 | | |
61 | 48 | | |
62 | | - | |
| 49 | + | |
63 | 50 | | |
64 | | - | |
65 | | - | |
66 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
67 | 54 | | |
68 | 55 | | |
69 | 56 | | |
70 | 57 | | |
71 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
0 commit comments