175#ifndef CWIST_WASI_SOCKETS
gRPC over HTTP/2 helpers for CWIST.
const cwist_http2_stream_hooks * cwist_grpc_http2_hooks(void)
Access the gRPC HTTP/2 stream hooks table.
HTTP/2 Protocol Definitions for CWIST.
cwist_h2_async_queue * cwist_h2_async_queue_acquire(cwist_h2_async_queue *q)
Take an additional reference on the queue (for an in-flight cwist_async handle).
cwist_error_t cwist_http2_serve_connection_ex(cwist_https_connection *conn, void *user_ctx, cwist_http2_request_handler_func handler, const cwist_http2_stream_hooks *hooks)
Serve one HTTP/2 connection until it closes. Verifies the preface, sends our SETTINGS,...
int cwist_h2_async_queue_enqueue(cwist_h2_async_queue *q, uint32_t stream_id, cwist_http_request *req, cwist_http_response *send, cwist_http_response *res, bool send_owned)
void cwist_h2_async_queue_release(cwist_h2_async_queue *q)
Drop a reference on the queue. On the last reference: closes the wake descriptors,...
struct cwist_h2_async_queue cwist_h2_async_queue
void(* cwist_http2_request_handler_func)(void *user_ctx, cwist_http_request *req, cwist_http_response *res)
Callback function type for handling HTTP/2 requests.
cwist_http_request * cwist_https_receive_request(cwist_https_connection *conn)
Read from the TLS stream until a full HTTP request has been assembled.
cwist_error_t cwist_https_send_response(cwist_https_connection *conn, cwist_http_response *res)
Serialize an HTTP response and send it over an active TLS connection.
void cwist_https_close_connection(cwist_https_connection *conn)
Production-grade metrics engine for CWIST.
cwist_metrics_registry_t * cwist_metrics_registry(void)
Obtain the global registry, creating it on first call.
enum cwist_metric_id cwist_metric_id_t
Pre-defined framework metrics.
struct cwist_metrics_registry cwist_metrics_registry_t
Global metrics registry (singleton, lazy-initialised).
void cwist_metric_inc(cwist_metrics_registry_t *reg, cwist_metric_id_t id)
Increment a counter metric by 1.
HTTPS/TLS wrapper interface.
void https_pool_submit_conn(cwist_https_connection *conn, cwist_https_context *ctx, void(*handler)(cwist_https_connection *, void *), void *user_ctx)
Submit an established connection back to the worker pool (e.g. keep-alive re-arm after async defer)....
cwist_error_t cwist_https_send_response_head(cwist_https_connection *conn, cwist_http_response *res)
bool cwist_https_connection_uses_http2(const cwist_https_connection *conn)
Gracefully close an HTTPS connection and free its buffers.
struct cwist_reactor cwist_reactor_t
bool cwist_reactor_timer_arm(cwist_reactor_t *reactor, cwist_reactor_timer_t *timer, uint64_t delay_us)
bool cwist_reactor_add(cwist_reactor_t *reactor, int fd, cwist_reactor_cb_t cb, const void *payload, size_t payload_size)
void cwist_reactor_timer_init(cwist_reactor_timer_t *timer, void(*cb)(void *ctx), void *ctx)
bool cwist_reactor_del(cwist_reactor_t *reactor, int fd)
void(* cwist_reactor_cb_t)(int fd, void *ctx)
void cwist_reactor_destroy(cwist_reactor_t *reactor)
void cwist_reactor_stop(cwist_reactor_t *reactor)
cwist_reactor_t * cwist_reactor_create(void)
void cwist_reactor_run(cwist_reactor_t *reactor)
bool cwist_reactor_mod(cwist_reactor_t *reactor, int fd, cwist_reactor_cb_t cb, const void *payload, size_t payload_size)
bool cwist_reactor_timer_armed(const cwist_reactor_timer_t *timer)
void cwist_reactor_timer_cancel(cwist_reactor_t *reactor, cwist_reactor_timer_t *timer)
bool cwist_reactor_add_out(cwist_reactor_t *reactor, int fd, cwist_reactor_cb_t cb, const void *payload, size_t payload_size)
Integrated error structure used throughout the system.
__prim_cwist_error_t error
HTTP Response Object. Supports standard string body or Zero-Copy pointer body.
WASI target feature detection shared by all CWIST sources.
Zero-latency speculative fast-path writer and P2C worker scheduler.
cwist_write_status_t cwist_http_sendmsg_speculative(int fd, struct iovec *iov, int iovcnt, int flags, size_t *total_sent)
Speculative scatter/gather sendmsg without blocking poll().
uint32_t cwist_fast_monotonic_sec(void)
Fast monotonic clock in seconds (vDSO coarse where available).