![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
n_http3 example + self-test: parse a URL (always) and, when built with HAVE_HTTP3, optionally fetch a live https URL over HTTP/3. More...
Include dependency graph for ex_http3.c:Go to the source code of this file.
Macros | |
| #define | CHECK(cond) |
| tiny assert that keeps going and tallies failures | |
Functions | |
| int | main (int argc, char **argv) |
| static void | test_parse_url (void) |
| exercise the pure URL parser (runs in every build) | |
| static void | test_request_guards (void) |
| exercise the request entry points' guards + delegation (deterministic, no network) | |
Variables | |
| static int | g_fails = 0 |
| test counter | |
n_http3 example + self-test: parse a URL (always) and, when built with HAVE_HTTP3, optionally fetch a live https URL over HTTP/3.
Usage: ex_http3 [https://host/path]
The URL-parser checks run in every build and make this double as a unit test (a non-zero exit signals a failure). A live fetch is attempted only when a URL argument is given and the library was built with HAVE_HTTP3; against an authorized, reachable HTTP/3 host it prints the status, headers, and body size.
Definition in file ex_http3.c.
| #define CHECK | ( | cond | ) |
tiny assert that keeps going and tallies failures
Definition at line 44 of file ex_http3.c.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 95 of file ex_http3.c.
References N_HTTP3_RESPONSE::body_len, N_HTTP3_RESPONSE::error, g_fails, N_HTTP3_RESPONSE::headers, LOG_ERR, LOG_NOTICE, n_http3_available(), n_http3_get(), N_HTTP3_REQ_ALLOW_ILLEGAL_HEADERS, n_http3_request_ex(), n_http3_response_free(), n_log, set_log_level(), N_HTTP3_RESPONSE::status, test_parse_url(), and test_request_guards().
Here is the call graph for this function:
|
static |
exercise the pure URL parser (runs in every build)
Definition at line 53 of file ex_http3.c.
References CHECK, n_http3_parse_url(), and port.
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
exercise the request entry points' guards + delegation (deterministic, no network)
Definition at line 82 of file ex_http3.c.
References CHECK, N_HTTP3_RESPONSE::error, N_HTTP3_REQ_ALLOW_ILLEGAL_HEADERS, n_http3_request(), n_http3_request_ex(), and n_http3_response_free().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |