RFC 9114 4.1 / 4.3.1, RFC 9204 4.5: drive HTTP/3 requests end to end: QPACK-encode and frame outgoing GET or arbitrary-method requests, and recover the pseudo-headers of received ones.
More...
#include "app/http3/core/h3/priority.h"
#include "app/qpack/qpack/dyntable.h"
#include "common/bytes/span/span.h"
#include "common/platform/sys/syscall.h"
Go to the source code of this file.
|
| int | wired_h3reqdrive_send_get (u64 stream_id, const wired_h3reqdrive_get_in *in, quic_obuf *out) |
| | RFC 9114 4.1 / 4.3.1, RFC 9204 4.5: drive an HTTP/3 GET request end to end: QPACK-encode the request pseudo-headers (h3reqenc), wrap them in a HEADERS frame and a QUIC STREAM frame (h3conn).
|
| int | wired_h3reqdrive_send_method (u64 stream_id, const wired_h3reqdrive_send_in *in, quic_obuf *out) |
| | RFC 9114 4.1 / 4.3.1, RFC 9204 4.5: drive an arbitrary-method HTTP/3 request end to end: QPACK-encode the request pseudo-headers with the given :method, append a DATA frame when in->body is non-empty, and wrap in a STREAM frame.
|
| int | wired_h3reqdrive_recv_get (quic_span stream_data, quic_mspan scratch, wired_h3reqdrive_req *r) |
| | RFC 9114 4.1, RFC 9204 4.5: decode a STREAM frame carrying a request: recover :method, :scheme, :authority and :path from the leading HEADERS frame's QPACK field section.
|
| int | wired_h3reqdrive_recv_get_dyn (quic_span stream_data, quic_mspan scratch, const quic_qpack_dyn *dyn, wired_h3reqdrive_req *r) |
| | Same as wired_h3reqdrive_recv_get, but also resolves dynamic-table references (RFC 9204 4.5.2/4.5.3 Indexed Field Line / Indexed Field Line with Post-Base Index) against dyn – the connection's QPACK dynamic table (0 behaves exactly like wired_h3reqdrive_recv_get: every dynamic reference then simply fails to resolve).
|
| int | wired_h3reqdrive_trailer_ok (quic_span stream_data, quic_mspan scratch) |
| | RFC 9114 4.3: check that a request stream's trailer section (if any) carries no pseudo-header field – a pseudo-header is only valid in the leading field section.
|
RFC 9114 4.1 / 4.3.1, RFC 9204 4.5: drive HTTP/3 requests end to end: QPACK-encode and frame outgoing GET or arbitrary-method requests, and recover the pseudo-headers of received ones.
◆ wired_h3reqdrive_recv_get()
RFC 9114 4.1, RFC 9204 4.5: decode a STREAM frame carrying a request: recover :method, :scheme, :authority and :path from the leading HEADERS frame's QPACK field section.
Literal values are copied into scratch. A trailing DATA frame (POST/PUT/PATCH body) is viewed in place via r->body / r->body_len; bodyless requests leave body_len 0.
- Parameters
-
| stream_data | the STREAM frame payload carrying the request |
| scratch | caller-supplied buffer backing r's literal values; the caller keeps it alive while r is in use |
| r | receives the recovered pseudo-headers and body view |
- Returns
- 1 on success, 0 on a malformed frame or field section.
◆ wired_h3reqdrive_recv_get_dyn()
Same as wired_h3reqdrive_recv_get, but also resolves dynamic-table references (RFC 9204 4.5.2/4.5.3 Indexed Field Line / Indexed Field Line with Post-Base Index) against dyn – the connection's QPACK dynamic table (0 behaves exactly like wired_h3reqdrive_recv_get: every dynamic reference then simply fails to resolve).
- Parameters
-
| stream_data | the STREAM frame payload carrying the request |
| scratch | caller-supplied buffer backing r's literal values; the caller keeps it alive while r is in use |
| dyn | the connection's dynamic table, or 0 if none is tracked |
| r | receives the recovered pseudo-headers and body view |
- Returns
- 1 on success, 0 on a malformed frame, field section, or an unresolvable/invalid dynamic-table reference (RFC 9204 4.5.1.2).
◆ wired_h3reqdrive_send_get()
RFC 9114 4.1 / 4.3.1, RFC 9204 4.5: drive an HTTP/3 GET request end to end: QPACK-encode the request pseudo-headers (h3reqenc), wrap them in a HEADERS frame and a QUIC STREAM frame (h3conn).
- Parameters
-
| stream_id | the request stream id to write in the STREAM frame |
| in | the :path and :authority values |
| out | receives the encoded STREAM frame |
- Returns
- 1 with out->len set, 0 on overflow.
◆ wired_h3reqdrive_send_method()
RFC 9114 4.1 / 4.3.1, RFC 9204 4.5: drive an arbitrary-method HTTP/3 request end to end: QPACK-encode the request pseudo-headers with the given :method, append a DATA frame when in->body is non-empty, and wrap in a STREAM frame.
- Parameters
-
| stream_id | the request stream id to write in the STREAM frame |
| in | the request line (method/path/authority) and the optional body |
| out | receives the encoded STREAM frame |
- Returns
- 1 with out->len set, 0 on overflow.
◆ wired_h3reqdrive_trailer_ok()
RFC 9114 4.3: check that a request stream's trailer section (if any) carries no pseudo-header field – a pseudo-header is only valid in the leading field section.
Vacuously ok when there is no trailer.
- Parameters
-
| stream_data | the STREAM frame payload carrying the request |
| scratch | caller-supplied scratch backing the trailer's literal values during the walk (discarded once this call returns) |
- Returns
- 1 if there is no trailer or it is free of pseudo-headers, 0 if the trailer is malformed or carries a pseudo-header.