|
KEEL 1.0.0
Minimal C11 HTTP client/server library built on epoll/kqueue/io_uring/poll
|
#include <router.h>

Data Fields | |
| const char * | method |
| const char * | pattern |
| size_t | method_len |
| size_t | pattern_len |
| KlHandler | handler |
| void * | user_data |
| KlBodyReaderFactory | body_reader |
| KlWsServerConfig * | ws_config |
| int | streaming_handler |
| int | streaming_async |
| const char* KlRoute::method |
HTTP method ("GET", "POST", "*")
| const char* KlRoute::pattern |
URL pattern ("/path", "/path/:param")
| size_t KlRoute::method_len |
Length of method string
| size_t KlRoute::pattern_len |
Length of pattern string
| KlHandler KlRoute::handler |
Handler function
| void* KlRoute::user_data |
Opaque data passed to handler
| KlBodyReaderFactory KlRoute::body_reader |
Body reader factory (NULL = discard body)
| KlWsServerConfig* KlRoute::ws_config |
WebSocket config (non-NULL = WebSocket endpoint)
| int KlRoute::streaming_handler |
1 = invoke handler after body_reader setup BEFORE the body is fully read; the handler may yield mid-stream and the body reader's on_data callback is responsible for resuming. Used by streaming multipart and similar pull-from-body APIs.
| int KlRoute::streaming_async |
1 = invoke handler BEFORE feeding any leftover body bytes via on_data (v2.2.0+). Requires the handler to yield on NEED_DATA — it'll be resumed by the body reader's on_data callback for the leftover AND subsequent socket reads.
Implies streaming_handler=1 — set both via kl_server_route_streaming_async.
Enables the full error-path mid-stream early-exit (a structured response can be written even when the cap fires inside leftover processing). Routes that opt out (use the legacy kl_server_route_streaming) still get the partial early-exit covering caps that fire after dispatch.