15#ifndef DETERMINISTICESPASYNCWEBSERVER_SERVER_INTERNAL_H
16#define DETERMINISTICESPASYNCWEBSERVER_SERVER_INTERNAL_H
35bool regex_match(
const char *pattern,
const char *path);
41#if DETWS_ENABLE_FILE_SERVING
79#if DETWS_ENABLE_FILE_SERVING
91#if DETWS_ENABLE_WEBSOCKET
93bool ws_do_upgrade(uint8_t slot_id,
HttpReq *req, WsConnectHandler on_connect);
96void ws_send_version_required(uint8_t slot_id);
101bool sse_do_upgrade(uint8_t slot_id,
HttpReq *req, SseConnectHandler on_connect);
#define MAX_CONNS
Maximum simultaneous TCP connections (fixed static pool; ~3.95 KB of internal RAM per slot).
Layer 7 (Application) - public HTTP routing API.
size_t(* ChunkSource)(uint8_t *buf, size_t cap, void *ctx)
Source callback that produces a chunked response body incrementally.
void fill_route_base(Route *r, const char *path)
Initialize the common fields (path, flags) of a route-table entry from its pattern.
const char * status_text(int code)
Reason phrase for an HTTP status code (e.g. 404 -> "Not Found").
void http_rfc1123(time_t t, char *out, size_t cap)
Format t as an RFC 1123 GMT date into out (cap bytes); out is emptied for t <= 0.
bool req_is_head(uint8_t slot_id)
True if the request in slot slot_id used the HEAD method (send headers, no body).
bool regex_match(const char *pattern, const char *path)
Whole-path regex match (anchored both ends; bounded by RE_MAX_STEPS, fails closed)....
ChunkSource source
body generator (active==false means none).
int status
response status, for note_response.
void * ctx
caller state passed to source (must outlive the send).
bool raw
HTTP/1.0 client: stream the body unframed, close-delimited (no chunk wrapping).
bool active
a chunked response is in progress on this slot.
int total
body bytes emitted so far (excludes framing).
bool keep
keep-alive vs close at completion.
Fully-parsed HTTP/1.1 request.
Internal route entry stored in the routing table.
ChunkSend chunk[MAX_CONNS]