wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
srvloop.h
Go to the documentation of this file.
1#ifndef WIRED_SRVLOOP_SRVLOOP_H
2#define WIRED_SRVLOOP_SRVLOOP_H
3
4#include "app/http3/core/h3/control.h"
5#include "app/http3/core/h3/priority.h"
6#include "app/http3/core/h3settings/control_settings.h"
9#include "app/http3/server/srvloop/body_window.h"
11#include "tls/ext/stp/server_tp.h"
13#include "transport/conn/pnspace/pnspaces/recv_spaces.h"
14#include "transport/packet/frame/frame/connctl.h"
15#include "transport/packet/frame/frame/ncid.h"
16#include "transport/recovery/detect/recovery/ackpolicy.h"
17
25
31#define WIRED_SRVLOOP_MAX_ACK_DELAY_MS 25
32
35#define WIRED_SRVLOOP_NCID_RX 4
36
39#define WIRED_SRVLOOP_PATH_RX 2
40
72typedef int (*wired_srvloop_handler)(
73 void* ctx,
74 const wired_h3reqdrive_req* req,
75 u64 offset,
76 wired_obuf* body_out,
77 const char** content_type,
78 int* more,
79 u64* total_size);
80
102 void* ctx,
103 const wired_h3reqdrive_req* req,
104 u64 stream_id,
105 wired_span chunk,
106 int fin);
107
116#ifndef WIRED_SRVLOOP_MAX_STREAMS
117#define WIRED_SRVLOOP_MAX_STREAMS 40
118#endif
119
127static inline u64 wired_srvloop_stream_limit(u64 configured) {
128 u64 v = configured ? configured : STP_DEFAULT_MAX_STREAMS_BIDI;
130}
131
137typedef struct {
138 int in_use;
145 u8 req_scratch[WIRED_H3_MAX_FIELD_SECTION];
146 /* RFC 9000 2.2: this stream reassembled across datagrams. curl splits one
147 * request's HEADERS and DATA into separate STREAM frames in separate 1-RTT
148 * packets; each frame's data is written at its offset here and the request
149 * is decoded only once FIN arrives. A byte past the window
150 * is past the stream's credit (req_over, flow_control_violation). */
151 u8 req_buf[BODYWIN_CAP];
184
190#define WIRED_SRVLOOP_MAX_PENDING_PRIORITY 8
191
199
205#define WIRED_SRVLOOP_CTRL_BUF_CAP 512
206
223
236#ifndef WIRED_SRVLOOP_MAX_WT_STREAMS
237#define WIRED_SRVLOOP_MAX_WT_STREAMS 24
238#endif
239
257#ifndef WIRED_SRVLOOP_WT_BUF_CAP
258#define WIRED_SRVLOOP_WT_BUF_CAP 49152
259#endif
260
261/* The advertised per-stream window (STP_DEFAULT_STREAM_DATA_LOCAL,
262 * server_tp.h) is a promise to buffer that many bytes past delivery, and
263 * both WT directions land in exactly this capacity's reassembly window --
264 * so the two must stay equal (see WIRED_SRVLOOP_WT_BUF_CAP's comment
265 * above for the failure mode when they drift). server_tp.c itself cannot
266 * see this macro (tls sits below app), but this header already includes
267 * server_tp.h, so the check lives here instead; test_server_tp_ids_and_
268 * values (server_tp_test.c) still pins the actual encoded TP bytes, which
269 * this assert does not exercise. */
270_Static_assert(
271 STP_DEFAULT_STREAM_DATA_LOCAL == WIRED_SRVLOOP_WT_BUF_CAP,
272 "the advertised stream window must match the reassembly buffer it backs");
273
281#define WIRED_SRVLOOP_WT_MAX_RANGES 8
282
308
383
397#define WIRED_SRVLOOP_MAX_WT_UNI_STREAMS 9
398
415
464
477#define WIRED_SRVLOOP_MAX_RX_DATAGRAMS 256
478
484#define WIRED_SRVLOOP_RX_DATAGRAM_CAP 1200
485
492
500typedef struct {
502 u64 bm[16];
504
510#define WIRED_SRVLOOP_RESET_Q \
511 ((usz)2 * (WIRED_SRVLOOP_MAX_STREAMS + WIRED_SRVLOOP_MAX_WT_STREAMS + \
512 WIRED_SRVLOOP_MAX_WT_UNI_STREAMS))
513
520
525
528
536// NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
537typedef struct {
624 void* req_ctx;
929 const char* qlog_path;
979
985 wired_srvloop* l, wired_srvloop_handler cb, void* ctx);
986
993int wired_srvloop_init(wired_srvloop* l, const u8* cli_scid, u8 cli_scid_len);
994
1006
1018 wired_srvloop* l, u64 stream_id, const h3_priority* p);
1019
1030 const wired_srvloop* l, u64 stream_id, h3_priority* out);
1031
1042
1050
1058
1066
1074
1087
1093
1103
1107
1124 u64 abs_off,
1125 usz n,
1126 usz* rel_off,
1127 usz* accepted_n);
1128
1142 wired_srvloop_wt_window* win, u8* buf, usz cap, u64 delivered_to);
1143
1150
1160 const wired_srvloop_conn* conn, wired_mspan dgram, wired_obuf* out);
1161
1173
1174#endif
RFC 9114 4.1 / 4.3.1, RFC 9204 4.5: drive HTTP/3 requests end to end: QPACK-encode and frame outgoing...
RFC 9001 4 / 4.1.2, RFC 8446 4 / 4.4.4, RFC 9000 7: server-side handshake orchestrator,...
Value-type views that fold the SDK's recurring argument shapes into single parameters,...
static u64 wired_srvloop_uni_stream_limit(void)
RFC 9000 4.6: the client-initiated UNI stream limit the server initially advertises,...
Definition srvloop.h:412
#define WIRED_SRVLOOP_MAX_WT_STREAMS
RFC 9000 2.2: how many concurrent WebTransport bidi streams (draft-ietf- webtrans-http3-15 4....
Definition srvloop.h:237
void wired_srvloop_wt_window_accept(wired_srvloop_wt_window *win, u64 abs_off, usz n, usz *rel_off, usz *accepted_n)
draft-ietf-webtrans-http3-15 4.3: clamp [abs_off, abs_off+n) to win's currently open window (drop the...
void wired_srvloop_wt_window_slide(wired_srvloop_wt_window *win, u8 *buf, usz cap, u64 delivered_to)
draft-ietf-webtrans-http3-15 4.3 / RFC 9000 4.1: once delivered_to (an absolute offset,...
#define WIRED_SRVLOOP_WT_MAX_RANGES
How many disjoint received-but-not-yet-contiguous byte ranges one WT slot's window tracks past its fr...
Definition srvloop.h:281
void wired_srvloop_set_handler(wired_srvloop *l, wired_srvloop_handler cb, void *ctx)
Register the app response-body builder; pass 0 to clear (body-less 200).
#define WIRED_SRVLOOP_CTRL_BUF_CAP
Byte capacity of the peer control stream's reassembly buffer (RFC 9114 6.2.1, RFC 9218 7....
Definition srvloop.h:205
#define WIRED_SRVLOOP_WT_BUF_CAP
Byte capacity of one WT bidi/uni reassembly slot's receive window (buf below).
Definition srvloop.h:258
#define WIRED_SRVLOOP_MAX_WT_UNI_STREAMS
draft-ietf-webtrans-http3-15 4.3: how many concurrent WebTransport uni streams (client-initiated,...
Definition srvloop.h:397
static u64 wired_srvloop_stream_limit(u64 configured)
Advertised initial_max_streams_bidi resolved from configured (0 = the built-in default) and clamped t...
Definition srvloop.h:127
int(* wired_srvloop_on_body)(void *ctx, const wired_h3reqdrive_req *req, u64 stream_id, wired_span chunk, int fin)
Receive a request body as it streams in (RFC 9114 4.1), instead of having it buffered whole into req'...
Definition srvloop.h:101
void wired_srvloop_closed_mark(wired_srvloop_closed *w, u64 stream_id)
Record stream_id's id-space index in w (see srvloop.c's closed-set doc: exact ids over a sliding 1024...
#define WIRED_SRVLOOP_PATH_RX
PATH_CHALLENGE frames latched until answered (wired_srvloop.path_challenge_rx_data); more are dropped...
Definition srvloop.h:39
int wired_srvloop_step(const wired_srvloop_conn *conn, wired_mspan dgram, wired_obuf *out)
Drive one wire iteration: open dgram, dispatch it, and if the step produced a server-direction packet...
#define WIRED_SRVLOOP_RX_DATAGRAM_CAP
Byte capacity of one queued received QUIC DATAGRAM's payload (RFC 9221 5/3).
Definition srvloop.h:484
#define WIRED_SRVLOOP_MAX_STREAMS
RFC 9000 2.2: how many client bidi (request) streams one connection can reassemble concurrently.
Definition srvloop.h:117
int wired_srvloop_closed_has(const wired_srvloop_closed *w, u64 stream_id)
1 if stream_id's index is recorded in w (or below its window).
#define WIRED_SRVLOOP_RESET_Q
RFC 9000 19.4/19.5: peer RESET_STREAM/STOP_SENDING frames one step can queue.
Definition srvloop.h:510
void wired_srvloop_priority_apply(wired_srvloop *l, u64 stream_id, const h3_priority *p)
RFC 9218 7.1 / 10: apply a validated PRIORITY_UPDATE (request variant) to stream_id – directly into i...
int wired_srvloop_priority_of(const wired_srvloop *l, u64 stream_id, h3_priority *out)
RFC 9218 10: read stream_id's current priority (its RFC 9218 4.1 default until any PRIORITY_UPDATE or...
#define WIRED_SRVLOOP_MAX_PENDING_PRIORITY
RFC 9218 7.1 / 10: how many PRIORITY_UPDATE frames naming a not-yet-open request stream one connectio...
Definition srvloop.h:190
void wired_srvloop_wt_refuse(wired_srvloop *l, u64 stream_id)
RFC 9114 8.1: queue client WT bidi stream_id for refusal (wt_refused) because no slot was free – unle...
#define WIRED_SRVLOOP_MAX_RX_DATAGRAMS
RFC 9221 5: how many received QUIC DATAGRAM frames one connection queues before a future consumer (a ...
Definition srvloop.h:477
void wired_srvloop_wt_uni_slot_release(wired_srvloop *l, u64 stream_id)
Same as wired_srvloop_wt_slot_release, for the separate wt_uni_streams table.
int wired_srvloop_wt_uni_slot_claim(wired_srvloop *l, u64 stream_id)
draft-ietf-webtrans-http3-15 4.3: claim and reset a free wt_uni_streams slot for stream_id,...
int wired_srvloop_wt_slot_claim(wired_srvloop *l, u64 stream_id)
draft-ietf-webtrans-http3-15 4.3: claim and reset a free wt_streams slot for stream_id,...
#define WIRED_SRVLOOP_NCID_RX
NEW_CONNECTION_ID frames kept per step (wired_srvloop.ncid_rx); more are dropped – the peer may issue...
Definition srvloop.h:35
int(* wired_srvloop_handler)(void *ctx, const wired_h3reqdrive_req *req, u64 offset, wired_obuf *body_out, const char **content_type, int *more, u64 *total_size)
Build (a round of) the response body for a decoded request.
Definition srvloop.h:72
void wired_srvloop_slot_release(wired_srvloop *l, u64 stream_id)
RFC 9000 2.2: free the streams[] slot reassembling stream_id, once its response has been fully sent a...
void wired_srvloop_ecn_note(wired_srvloop *l, u8 ecn)
RFC 9000 13.4 / RFC 9002 19.3.2: add one received datagram's ECN codepoint (RFC 3168: 0 Not-ECT,...
void wired_srvloop_wt_slot_release(wired_srvloop *l, u64 stream_id)
draft-ietf-webtrans-http3-15 4.3: free the wt_streams[] slot reassembling stream_id once its FIN has ...
int wired_srvloop_wt_uni_slot_find(const wired_srvloop *l, u64 stream_id)
draft-ietf-webtrans-http3-15 4.3: find the wt_uni_streams slot already reassembling stream_id,...
int wired_srvloop_slot_for(wired_srvloop *l, u64 stream_id)
RFC 9000 2.2: the streams[] slot reassembling request stream_id, allocating a free one on first sight...
int wired_srvloop_wt_slot_find(const wired_srvloop *l, u64 stream_id)
draft-ietf-webtrans-http3-15 4.3: find the wt_streams slot already reassembling stream_id,...
int wired_srvloop_wt_slot_claim_local(wired_srvloop *l, u64 stream_id)
RFC 9000 2.1: pre-claim a wt_streams slot for a stream id THIS endpoint itself opened (a server-initi...
int wired_srvloop_init(wired_srvloop *l, const u8 *cli_scid, u8 cli_scid_len)
Record the client's source connection id (the DCID for server-sent packets) and reset the HTTP/3 stat...
RFC 9114 6.2.1 / 7.2.4 / 4.1.
Delayed-ACK timer state for one packet number space.
Definition ackpolicy.h:14
One request stream's receive window over a caller-owned BODYWIN_CAP buffer: buf[0] is stream offset b...
Definition body_window.h:33
RFC 9114 6.2.1/7.2.4/5.2: this connection's control-stream state — whether it is open,...
Definition control.h:26
RFC 9218 4: a request's priority — urgency (lower is more urgent) and whether the response may be ser...
Definition priority.h:15
One NEW_CONNECTION_ID frame's fields.
Definition ncid.h:14
Per-space received-packet-number tracking (recvpn), one per PNS_*.
Definition recv_spaces.h:18
RFC 9114 4.1 / 4.3.1, RFC 9204 4.5: recovered request pseudo-headers.
Definition request_drive.h:69
HTTP/3 server response-layer state after the 1-RTT handshake.
Definition state.h:16
Mutable view of a byte range.
Definition span.h:42
Growing output buffer view for variable-length results.
Definition span.h:54
Server-side handshake orchestrator state, initialized by wired_server_init.
Definition server.h:46
Read-only view of a byte range.
Definition span.h:30
RFC 9000 3.2: closed client stream indexes (id / 4) of one stream type – every index below floor,...
Definition srvloop.h:500
u64 bm[16]
the 1024 indexes from floor up
Definition srvloop.h:502
u64 floor
every index below this is closed
Definition srvloop.h:501
The loop and its orchestrator, driven together through every wire step (mirrors wired_srvboot_conn,...
Definition srvloop.h:1146
wired_srvloop * l
the server wire loop
Definition srvloop.h:1147
wired_server * s
server-side handshake orchestrator
Definition srvloop.h:1148
The peer's control stream, reassembled across datagrams (RFC 9000 2.2) past its leading type varint,...
Definition srvloop.h:215
u64 stream_id
the claimed stream's id; later chunks must match
Definition srvloop.h:221
u8 open
a 0x00-typed offset-0 uni frame claimed the stream
Definition srvloop.h:220
u8 buf[WIRED_SRVLOOP_CTRL_BUF_CAP]
offset-indexed control bytes
Definition srvloop.h:216
usz len
highest offset+len written into buf
Definition srvloop.h:218
u64 base
post-type stream offset of buf[0]
Definition srvloop.h:217
usz parsed
bytes already walked as complete HTTP/3 frames
Definition srvloop.h:219
One buffered PRIORITY_UPDATE naming a request stream this connection has not opened yet (RFC 9218 10 ...
Definition srvloop.h:194
h3_priority priority
the priority to apply once it opens
Definition srvloop.h:197
int in_use
0 marks a free slot
Definition srvloop.h:195
u64 stream_id
the not-yet-open request stream id
Definition srvloop.h:196
One peer RESET_STREAM (is_stop 0) or STOP_SENDING (is_stop 1).
Definition srvloop.h:515
u64 error_code
its wire application error code
Definition srvloop.h:517
int is_stop
1 for STOP_SENDING, 0 for RESET_STREAM
Definition srvloop.h:518
u64 stream_id
stream id the frame named
Definition srvloop.h:516
One queued received QUIC DATAGRAM frame's payload (RFC 9221 5).
Definition srvloop.h:488
u8 buf[WIRED_SRVLOOP_RX_DATAGRAM_CAP]
the datagram's payload bytes
Definition srvloop.h:489
usz len
bytes valid in buf
Definition srvloop.h:490
One request stream's cross-datagram reassembly state — everything the original single-stream wired_sr...
Definition srvloop.h:137
int req_over
1 once a STREAM frame reached past req_buf's window: past the stream's credit (RFC 9000 4....
Definition srvloop.h:174
wired_h3reqdrive_req req
the decoded request, valid once req_done
Definition srvloop.h:141
int req_incomplete
RFC 9114 4.1: 1 once this stream's FIN arrived without enough of the request to decode (e....
Definition srvloop.h:160
u8 req_wrap[2080]
backing store for req's path/body views once decoded (see drive_complete in dispatch....
Definition srvloop.h:164
usz req_len
highest offset+len written into req_buf
Definition srvloop.h:152
int in_use
0 = free slot
Definition srvloop.h:138
u8 req_scratch[WIRED_H3_MAX_FIELD_SECTION]
backing store for req's path/body views; sized to the advertised SETTINGS_MAX_FIELD_SECTION_SIZE (one...
Definition srvloop.h:145
h3_priority priority
RFC 9218 4.1/7.1: this stream's current response priority, applied by a PRIORITY_UPDATE frame on the ...
Definition srvloop.h:171
u8 qpack_settled
RFC 9204 4.4.1 / 4.4.2: 1 once this stream's Section Acknowledgment or Stream Cancellation was queued...
Definition srvloop.h:178
bodywin body
RFC 9000 2.2/4.1: req_buf as a receive window – which bytes arrived (so only the contiguous prefix is...
Definition srvloop.h:182
int req_done
1 once this request was decoded/answered
Definition srvloop.h:154
u8 req_fin
1 once a request-stream FIN was seen
Definition srvloop.h:153
u64 stream_id
the client bidi stream id this slot reassembles
Definition srvloop.h:139
u8 req_buf[BODYWIN_CAP]
offset-indexed request stream bytes
Definition srvloop.h:151
One WebTransport bidi stream's cross-datagram reassembly state (draft- ietf-webtrans-http3-15 4....
Definition srvloop.h:317
int credit_hold
1 while the app (wired_server_wt_stream_hold) is holding this stream's receive credit: the caller dri...
Definition srvloop.h:381
wired_srvloop_wt_window win
receive-window bookkeeping, see its doc
Definition srvloop.h:335
u8 sig[16]
leading-signal reassembly for a signal split across STREAM frames (flupke sends the type varint alone...
Definition srvloop.h:331
int wt_session_slot
The session slot index (srvrun.c's wt/wt1, see SRVRUN_MAX_WT_SESSIONS) this stream was offered to,...
Definition srvloop.h:358
u64 delivered_len
how much of the stream (in win.base + win.frontier terms, i.e.
Definition srvloop.h:364
usz sig_len
bytes the leading 0x41 signal varint itself occupied on the wire (RFC 9000 16: 2 for 0x41's own encod...
Definition srvloop.h:326
u64 stream_id
the WT bidi stream id this slot reassembles
Definition srvloop.h:319
u8 fin
1 once this stream's FIN was seen
Definition srvloop.h:343
u8 sig_pending
1 from the signal claim until sig_len resolves; 0 for a pre-claimed reply stream (no signal at all)
Definition srvloop.h:333
u8 sig_have
bytes of sig[] filled, from offset 0 upward
Definition srvloop.h:332
u64 fin_off
the absolute offset FIN was seen at; valid only when fin
Definition srvloop.h:344
int offered
1 once wired_wt_session_offer_stream has been called for this slot's stream_id (the caller driving th...
Definition srvloop.h:351
u64 credit_advertised
RFC 9000 4.1/19.10: the MAX_STREAM_DATA value last advertised to the peer for this stream (0 before a...
Definition srvloop.h:375
int in_use
0 = free slot
Definition srvloop.h:318
u8 buf[WIRED_SRVLOOP_WT_BUF_CAP]
offset-indexed bytes past the signal varint, relative to win.base (offset 0 of this buffer is win....
Definition srvloop.h:342
int fin_delivered
1 once a fin=1 delivery has been made to the app-facing stream-data callback for this slot; distingui...
Definition srvloop.h:369
One WebTransport uni stream's cross-datagram reassembly state (draft-ietf- webtrans-http3-15 4....
Definition srvloop.h:422
u8 fin
1 once this stream's FIN was seen
Definition srvloop.h:442
u8 buf[WIRED_SRVLOOP_WT_BUF_CAP]
offset-indexed bytes past the type varint, relative to win.base.
Definition srvloop.h:441
u8 sig[16]
leading-signal reassembly buffer, same shape and role as wired_srvloop_wt_stream_slot's sig/sig_have/...
Definition srvloop.h:431
int credit_hold
1 while the app is holding this stream's receive credit, mirroring wired_srvloop_wt_stream_slot's cre...
Definition srvloop.h:462
wired_srvloop_wt_window win
receive-window bookkeeping, see its doc
Definition srvloop.h:437
int offered
1 once wired_wt_session_offer_stream has been called for this slot's stream_id, mirroring wired_srvlo...
Definition srvloop.h:446
u8 sig_pending
1 from the type-varint claim until type_len resolves; 0 once the signal is fully parsed.
Definition srvloop.h:436
int fin_delivered
1 once a fin=1 delivery has been made, mirroring wired_srvloop_wt_stream_slot's fin_delivered field.
Definition srvloop.h:456
u64 fin_off
the absolute offset FIN was seen at; valid only when fin
Definition srvloop.h:443
u64 credit_advertised
MAX_STREAM_DATA last advertised for this stream, mirroring wired_srvloop_wt_stream_slot's credit_adve...
Definition srvloop.h:459
int in_use
0 = free slot
Definition srvloop.h:423
u64 stream_id
the WT uni stream id this slot reassembles
Definition srvloop.h:424
u8 sig_have
bytes of sig[] filled so far, from offset 0 upward.
Definition srvloop.h:433
u64 delivered_len
how much of the stream (absolute offset) has already been delivered to an app-facing stream-data call...
Definition srvloop.h:453
usz type_len
bytes the leading type varint occupied on the wire (RFC 9000 16: 2 for 0x54's own encoding,...
Definition srvloop.h:428
int wt_session_slot
The session slot index this stream was offered to, mirroring wired_srvloop_wt_stream_slot's wt_sessio...
Definition srvloop.h:449
One WT bidi/uni slot's receive-window bookkeeping, shared shape for both tables (see wired_srvloop_wt...
Definition srvloop.h:295
u64 base
absolute post-signal stream offset of buf[0]
Definition srvloop.h:296
u64 range_hi[WIRED_SRVLOOP_WT_MAX_RANGES]
exclusive
Definition srvloop.h:298
u64 dropped_bytes
Cumulative bytes dropped at accept time because they landed past the granted window (receive-buffer o...
Definition srvloop.h:306
usz range_n
number of disjoint ranges currently tracked
Definition srvloop.h:299
u64 range_lo[WIRED_SRVLOOP_WT_MAX_RANGES]
relative to base
Definition srvloop.h:297
usz frontier
contiguous bytes from base, i.e.
Definition srvloop.h:300
Per-connection state of the server wire loop, re-armed by wired_srvloop_init and driven by wired_srvl...
Definition srvloop.h:537
u8 spare_cid[20]
RFC 9000 5.1.1/19.15: one spare connection ID handed to the client in a NEW_CONNECTION_ID frame at co...
Definition srvloop.h:546
usz reset_slotless_n
RFC 9000 4.6: RESET_STREAMs this step that closed a request stream which never got a slot (its STREAM...
Definition srvloop.h:700
u64 now_ms
Monotonic ms this step is being driven at – the time source ackpolicy's delayed-ACK timer measures ag...
Definition srvloop.h:607
u8 spare_cid_in_tp
RFC 9000 9.6/5.1.1: 1 once the spare CID was delivered inside the preferred_address transport paramet...
Definition srvloop.h:555
int ticket_sent
1 once the post-confirmation session ticket (NewSessionTicket, RFC 8446 4.6.1) has been emitted
Definition srvloop.h:610
usz incomplete_n
entries valid in incomplete_slots this step
Definition srvloop.h:673
int ctrl_overflow
RFC 9114 6.2.1: 1 once the peer control stream's unparsed backlog no longer fit WIRED_SRVLOOP_CTRL_BU...
Definition srvloop.h:945
u64 peer_stream_limit[2]
RFC 9000 4.6: the client bidi ([0]) and uni ([1]) stream limits currently advertised,...
Definition srvloop.h:972
usz ctrl_settings_len
RFC 9114 6.2.1: bytes of control-stream type + SETTINGS actually sent (respond.c's build_settings_fra...
Definition srvloop.h:977
u64 req_next_id
RFC 9114 5.2: one past the largest client request stream id a streams[] slot was ever claimed for (id...
Definition srvloop.h:934
u64 max_streams_uni_seen
RFC 9000 19.11: highest MAX_STREAMS(uni) value seen in any 1-RTT payload opened this step (gather_max...
Definition srvloop.h:817
u64 malformed_slots
RFC 9114 4.1.2: bit i is set when incomplete_slots holds slot i because its whole HEADERS was malform...
Definition srvloop.h:678
int np_seen
1 once np_hi holds a received packet number.
Definition srvloop.h:568
usz ncid_rx_n
Entries used in ncid_rx; reset at the start of every step.
Definition srvloop.h:843
u8 frame_unexpected_slots[WIRED_SRVLOOP_MAX_STREAMS]
RFC 9114 7.2.5/7.2.8 (9114-067/9114-073): every slot whose request stream carried a PUSH_PROMISE or H...
Definition srvloop.h:685
u8 spare_cid_token[16]
RFC 9000 10.3: the stateless reset token advertised for spare_cid.
Definition srvloop.h:550
u64 max_data_seen
RFC 9000 19.9: highest MAX_DATA value seen across every 1-RTT payload opened this step (gather_max_da...
Definition srvloop.h:767
wired_srvloop_stream_slot streams[WIRED_SRVLOOP_MAX_STREAMS]
RFC 9000 2.2: one reassembly slot per concurrent client bidi (request) stream, looked up/allocated by...
Definition srvloop.h:630
int hs_done_sent
1 once the confirmation (HANDSHAKE_DONE) has been emitted
Definition srvloop.h:608
u64 max_stream_data_value[WIRED_SRVLOOP_MAX_STREAMS]
RFC 9000 19.10: the value carried by the same-indexed max_stream_data_stream_id slot.
Definition srvloop.h:784
int datagram_violation
1 once a received DATAGRAM frame violated RFC 9221 3 (exceeded we_advertised_max_datagram,...
Definition srvloop.h:748
u64 wt_refused[WIRED_SRVLOOP_MAX_STREAMS]
RFC 9114 8.1: client WT bidi streams whose signal frame found every wt_streams[] slot busy.
Definition srvloop.h:961
u64 ecn_ce
CE running total (same lifecycle as ecn_ect0's doc above).
Definition srvloop.h:860
int app_rx_seen
1 once a 1-RTT packet has been received (app_rx_pn valid)
Definition srvloop.h:562
u64 tx_pn
monotone packet number for sealed 1-RTT output
Definition srvloop.h:556
u64 ecn_ack_ect0
its cumulative ECT(0) count
Definition srvloop.h:720
u8 incomplete_slots[WIRED_SRVLOOP_MAX_STREAMS]
RFC 9114 4.1: every slot whose request stream terminated (FIN) THIS step WITHOUT producing a request ...
Definition srvloop.h:672
usz peer_reset_n
frames queued this step
Definition srvloop.h:915
u64 hs_rx_pn
last received Handshake packet number to ACK (the client Finished's actual PN, which is not always 0)
Definition srvloop.h:578
u64 hs_tx_pn
monotone packet number for sealed Handshake output
Definition srvloop.h:557
wired_srvloop_closed uni_typed
RFC 9204 4.2 / RFC 9114 6.2: client uni streams whose leading type is already known (seen whole at of...
Definition srvloop.h:799
int req_frame_error
RFC 9114 7.1: 1 once a streamed request body ended inside a frame – a connection error of type H3_FRA...
Definition srvloop.h:941
u8 cli_scid_len
cli_scid length in octets
Definition srvloop.h:540
u8 done_slots[WIRED_SRVLOOP_MAX_STREAMS]
Every slot whose request completed THIS step, in completion order – the multi-request counterpart of ...
Definition srvloop.h:664
int peer_closed
1 once a peer CONNECTION_CLOSE frame was seen
Definition srvloop.h:688
pnspaces_recv ack_recv
RFC 9000 12.3/13.2.1/13.2.2/19.3: every packet number space's received-pn window (pnspaces_recv,...
Definition srvloop.h:589
int streams_blocked_uni_seen_flag
Same as streams_blocked_seen_flag, for a client UNI STREAMS_BLOCKED frame (0x17) – the two directions...
Definition srvloop.h:812
u64 we_advertised_max_datagram
RFC 9221 3: this connection's own advertised max_datagram_frame_size transport parameter value,...
Definition srvloop.h:742
int wt_signal_mid_stream_violation
draft-ietf-webtrans-http3-15 4.3: 1 once a STREAM frame this step carried the WT_STREAM signal varint...
Definition srvloop.h:907
u64 ecn_ack_ce
its cumulative ECN-CE count
Definition srvloop.h:722
u32 peer_reset_count
RFC 9000 19.4/19.5, RFC 9114 10.5 (CVE-2023-44487-class rapid reset): how many RESET_STREAM/STOP_SEND...
Definition srvloop.h:922
u64 peer_wt_initial[3]
draft-ietf-webtrans-http3-16 SS5.5.1-5.5.3: the client SETTINGS' SETTINGS_WT_INITIAL_MAX_STREAMS_UNI,...
Definition srvloop.h:883
usz wt_refused_n
Count of queued ids in wt_refused.
Definition srvloop.h:963
wired_h3reqdrive_req req
the mirrored most-recently-completed request; valid only when got_request is set
Definition srvloop.h:654
int streams_blocked_seen_flag
RFC 9000 19.14: 1 once a client bidi STREAMS_BLOCKED frame was seen in any 1-RTT payload opened this ...
Definition srvloop.h:807
wired_srvloop_closed wt_uni_closed
RFC 9000 3.2: client WT uni streams already released.
Definition srvloop.h:794
u16 confirm_frames_len
Bytes cached in confirm_frames; 0 until the confirmation was emitted (or when it did not fit,...
Definition srvloop.h:621
u64 req_body_released
RFC 9000 4.1: streamed request-body bytes consumed (window base) on every request slot released so fa...
Definition srvloop.h:954
int max_streams_uni_seen_flag
1 once max_streams_uni_seen was set this step; same convention as max_data_seen_flag.
Definition srvloop.h:818
u64 qlog_group
srvrun_conn.qlog_slot's value for this conn
Definition srvloop.h:930
wired_srvloop_pending_priority pending_priority[WIRED_SRVLOOP_MAX_PENDING_PRIORITY]
RFC 9218 10 / 9218-010: PRIORITY_UPDATE frames naming a request stream not yet open,...
Definition srvloop.h:867
int got_request
Mirrors the most recently completed request this step, across whichever slot decoded it — the pre-exi...
Definition srvloop.h:653
wired_h3srv_state h3
HTTP/3 server response-layer state.
Definition srvloop.h:538
ackpolicy app_ack_policy
App space's delayed-ACK timer.
Definition srvloop.h:590
u8 path_response_data[PATH_DATA]
RFC 9000 8.2.2/19.18: the 8-byte data of a PATH_RESPONSE frame seen in any 1-RTT payload opened this ...
Definition srvloop.h:834
u64 app_rx_pn
last received 1-RTT (application) packet number to ACK
Definition srvloop.h:558
u64 reset_slots
RFC 9000 3.2: bit i is set when a RESET_STREAM this step ended slot i's request while it was still be...
Definition srvloop.h:695
u16 priupdate_violation
RFC 9218 7.1 / RFC 9114 8.1: the H3 connection error code of the most recent rejected PRIORITY_UPDATE...
Definition srvloop.h:889
u8 confirm_frames[320]
The confirmation packet's frame payload (SETTINGS + session ticket + HANDSHAKE_DONE),...
Definition srvloop.h:618
int resp_external
1: the caller answers requests, not the loop
Definition srvloop.h:701
u8 ack_defer
When 1, respond.c's bare-ACK packet (emit_ack_only) is suppressed for the current step: the driving l...
Definition srvloop.h:597
usz path_challenge_rx_n
Entries latched in path_challenge_rx_data; the owner resets it.
Definition srvloop.h:827
int hs_rx_seen
1 once a Handshake packet has been received
Definition srvloop.h:582
wired_srvloop_reset peer_resets[WIRED_SRVLOOP_RESET_Q]
RFC 9000 19.4/19.5: every RESET_STREAM/STOP_SENDING this step carried, in arrival order,...
Definition srvloop.h:914
wired_srvloop_ctrl_stream ctrl
RFC 9114 6.2.1: the peer's single control stream, reassembled so its frames (SETTINGS/GOAWAY/PRIORITY...
Definition srvloop.h:872
u64 ack_hi[32]
range highs, ack_hi[0] from the frame's largest
Definition srvloop.h:708
wired_srvloop_wt_uni_stream_slot wt_uni_streams[WIRED_SRVLOOP_MAX_WT_UNI_STREAMS]
draft-ietf-webtrans-http3-15 4.3: one reassembly slot per concurrent WT uni stream,...
Definition srvloop.h:646
int max_data_seen_flag
1 once max_data_seen was set this step
Definition srvloop.h:768
u64 np_hi
RFC 9000 9.3: largest application packet number (0-RTT or 1-RTT) that carried a non-probing frame,...
Definition srvloop.h:566
int closed_stream_seen
1 once closed_stream_id was set this step
Definition srvloop.h:758
u8 path_challenge_rx_data[WIRED_SRVLOOP_PATH_RX][PATH_DATA]
RFC 9000 8.2.2: the peer's own PATH_CHALLENGE data latched by dispatch this step – the owning runner ...
Definition srvloop.h:825
u8 cli_scid[20]
the client's source id; DCID the server writes
Definition srvloop.h:539
u64 req_stream_id
the client bidi stream id req was decoded from; valid only when got_request is set (mirrors req from ...
Definition srvloop.h:656
ncid_frame ncid_rx[WIRED_SRVLOOP_NCID_RX]
RFC 9000 19.15: the well-formed NEW_CONNECTION_ID frames processed this step, in arrival order; the o...
Definition srvloop.h:841
usz done_n
entries valid in done_slots this step
Definition srvloop.h:665
wired_srvloop_handler on_request
app response-body builder, 0 if unset
Definition srvloop.h:623
u64 ecn_ack_ect1
its cumulative ECT(1) count
Definition srvloop.h:721
u64 ecn_ect1
ECT(1) running total (same lifecycle as ecn_ect0's doc above).
Definition srvloop.h:858
usz frame_unexpected_n
entries valid in frame_unexpected_slots this step
Definition srvloop.h:686
usz rx_datagram_n
count of entries valid in rx_datagrams, 0..WIRED_SRVLOOP_MAX_RX_DATAGRAMS.
Definition srvloop.h:735
u8 ecn_ack_seen
RFC 9000 19.3.2: the ECN counts of the type-0x03 ACK with the largest acknowledged packet number open...
Definition srvloop.h:718
u64 ecn_ack_largest
largest acknowledged pn of the ACK latched
Definition srvloop.h:719
ackpolicy hs_ack_policy
Handshake space's delayed-ACK timer.
Definition srvloop.h:591
u64 hs_rx_hi
Largest Handshake packet number received, valid with hs_rx_seen.
Definition srvloop.h:581
wired_srvloop_on_body on_body
Streams request bodies to the app (see wired_srvloop_on_body), its ctx being req_ctx; 0 buffers each ...
Definition srvloop.h:937
u8 spare_cid_len
Length of spare_cid; 0 means none was issued.
Definition srvloop.h:548
int flow_control_violation
RFC 9000 4.1: 1 once a request STREAM frame reached past its slot's window (req_over) – past the cred...
Definition srvloop.h:950
int wt_refused_overflow
RFC 9000 4.6: 1 once the peer opened past MAX_STREAMS – a refusal found wt_refused full (see wt_refus...
Definition srvloop.h:968
int ncid_malformed
RFC 9000 19.15: 1 once a malformed NEW_CONNECTION_ID arrived (Retire Prior To above its Sequence Numb...
Definition srvloop.h:847
h3_control peer_ctrl
RFC 9114 7.2.4 / draft-ietf-webtrans-http3-15 SS3.1 (WTH3-009/042): the client control stream's own S...
Definition srvloop.h:878
wired_srvloop_closed req_closed
RFC 9000 3.2: client bidi streams already answered and released – request streams and WT bidi streams...
Definition srvloop.h:635
int drop_newer
RFC 9000 9.6.2, set by the caller before a step: discard a 1-RTT packet numbered above every number r...
Definition srvloop.h:577
void * req_ctx
opaque ctx passed to on_request
Definition srvloop.h:624
wired_srvloop_rx_datagram rx_datagrams[WIRED_SRVLOOP_MAX_RX_DATAGRAMS]
RFC 9221 5: received QUIC DATAGRAM frame payloads queued for a future consumer to drain (Phase 7b Sli...
Definition srvloop.h:728
usz max_stream_data_n
Slots in max_stream_data_stream_id/_value actually used this step (0 to WIRED_SRVLOOP_MAX_STREAMS).
Definition srvloop.h:787
u16 qpack_stream_violation
RFC 9204 4.2 (9204-028): the H3 connection error code of a second QPACK encoder or decoder unidirecti...
Definition srvloop.h:896
u64 closed_stream_id
RFC 9000 19.4/19.8 (draft-ietf-webtrans-http3-15 SS4.4): the client bidi stream id a FIN or RESET_STR...
Definition srvloop.h:757
int step_np_new
1 iff this step processed a short-header 1-RTT packet that was non-probing and numbered above every e...
Definition srvloop.h:572
u64 app_rx_hi
Largest 1-RTT packet number received, valid with app_rx_seen: the baseline for recovering a truncated...
Definition srvloop.h:561
u64 max_stream_data_stream_id[WIRED_SRVLOOP_MAX_STREAMS]
RFC 9000 19.10: every distinct MAX_STREAM_DATA (stream id, value) seen this step, one slot per distin...
Definition srvloop.h:781
int path_response_seen_flag
1 once path_response_data was set this step; not reset across steps by this loop itself,...
Definition srvloop.h:835
u64 ack_lo[32]
ACK ranges (RFC 9000 19.3) seen in payloads opened this step, reset at the start of every wired_srvlo...
Definition srvloop.h:707
wired_srvloop_wt_stream_slot wt_streams[WIRED_SRVLOOP_MAX_WT_STREAMS]
draft-ietf-webtrans-http3-15 4.3: one reassembly slot per concurrent WT bidi stream,...
Definition srvloop.h:641
const char * qlog_path
qlog attribution for received-side stream frame events (mirrors srvrun_conn.qlog_slot/srvrun_cfg....
Definition srvloop.h:929
usz ack_n
ranges recorded this step
Definition srvloop.h:709
u64 ecn_ect0
RFC 9000 13.4 / RFC 9002 19.3.2: this connection's cumulative count of received datagrams marked ECT(...
Definition srvloop.h:856
unsigned int u32
unsigned 32-bit integer
Definition types.h:15
u64 usz
unsigned size (size_t equivalent)
Definition types.h:20
unsigned short u16
unsigned 16-bit integer
Definition types.h:17
unsigned char u8
unsigned 8-bit integer / byte
Definition types.h:18
unsigned long u64
unsigned 64-bit integer
Definition types.h:13