Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_http3.c File Reference

Implementation of the minimal blocking HTTP/3 client (see n_http3.h) More...

#include "nilorea/n_http3.h"
#include "nilorea/n_log.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+ Include dependency graph for n_http3.c:

Go to the source code of this file.

Functions

int n_http3_available (void)
 Report whether HTTP/3 support was compiled into the library.
 
int n_http3_get (const char *url, int timeout_ms, N_HTTP3_RESPONSE *out)
 Convenience wrapper: HTTP/3 GET of url.
 
int n_http3_parse_url (const char *url, char *host, size_t hostsz, char *port, size_t portsz, char *path, size_t pathsz)
 Split an https URL into host, port and path (pure; available in every build).
 
int n_http3_request (const char *method, const char *url, const char *headers, const unsigned char *body, size_t body_len, int timeout_ms, N_HTTP3_RESPONSE *out)
 Perform one blocking HTTP/3 request over a fresh QUIC connection.
 
int n_http3_request_ex (const char *method, const char *url, const char *headers, const unsigned char *body, size_t body_len, int timeout_ms, unsigned flags, N_HTTP3_RESPONSE *out)
 Perform one blocking HTTP/3 request, with request flags.
 
void n_http3_response_free (N_HTTP3_RESPONSE *r)
 Free the heap buffers held by r and zero the struct (safe on NULL / zeroed).
 

Detailed Description

Implementation of the minimal blocking HTTP/3 client (see n_http3.h)

Author
Castagnier Mickael
Version
1.0

The QUIC transport is driven by ngtcp2 and the HTTP/3 framing + QPACK by nghttp3; TLS 1.3 is handled by OpenSSL through the ngtcp2 "ossl" crypto shim (the OpenSSL native QUIC handshake). Everything below the pure helpers is compiled only under HAVE_HTTP3.

Definition in file n_http3.c.