wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
respond.h
1#ifndef WIRED_SRVLOOP_RESPOND_H
2#define WIRED_SRVLOOP_RESPOND_H
3
6#include "tls/keys/ticket/ticket.h"
7
15const u8* wired_srvloop_ticket_key(void);
16
17/* RFC 9000 12.2 / 13.2.1 / RFC 9114 6.2.1: pick the outbound datagram for one
18 * step. The first reply emits the confirmation (SETTINGS + HANDSHAKE_DONE),
19 * coalescing the 200 into its 1-RTT payload when the confirming datagram also
20 * carried a GET; later replies are a 200 or a bare 1-RTT ACK, the confirmation
21 * never repeated. Returns 1 and sets out->len when a packet was written, else
22 * 0.
23 */
24int wired_srvloop_produce(
25 const wired_srvloop_conn* conn, int got_request, wired_obuf* out);
26
27/* RFC 9000 13.2.1: encode the App space's pending multi-range ACK into buf
28 * WITHOUT clearing the pending state -- the deferred-ACK piggyback seam for
29 * a driving loop (srvrun.c) that decides fit-or-not after seeing the
30 * encoded length. Returns the encoded length, 0 when nothing is pending (or
31 * encoding fails). Pair with wired_srvloop_ack_mark_sent once the carrying
32 * packet is actually sent. */
33usz wired_srvloop_ack_peek(wired_srvloop* l, u8* buf, usz cap);
34
35/* Clear the pending-ACK state after a wired_srvloop_ack_peek result went
36 * out on the wire, so the next step's due-check starts fresh. */
37void wired_srvloop_ack_mark_sent(wired_srvloop* l);
38
39/* RFC 9000 19.20: replay the confirmation (SETTINGS + session ticket +
40 * HANDSHAKE_DONE) captured at its one-time emit, re-sealed under a fresh pn
41 * -- the recovery when the single confirmation datagram was lost and the
42 * client keeps probing its Finished. Returns 1 and sets out->len, or 0 when
43 * no confirmation was emitted (or cached) yet. */
44int wired_srvloop_reconfirm(const wired_srvloop_conn* conn, wired_obuf* out);
45
46#endif
Value-type views that fold the SDK's recurring argument shapes into single parameters,...
RFC 9001 4 / 5 / RFC 9000 17.2: the socket-free core of the server wire loop.
Growing output buffer view for variable-length results.
Definition span.h:54
The loop and its orchestrator, driven together through every wire step (mirrors wired_srvboot_conn,...
Definition srvloop.h:1146
Per-connection state of the server wire loop, re-armed by wired_srvloop_init and driven by wired_srvl...
Definition srvloop.h:537
u64 usz
unsigned size (size_t equivalent)
Definition types.h:20
unsigned char u8
unsigned 8-bit integer / byte
Definition types.h:18