KEEL 1.0.0
Minimal C11 HTTP client/server library built on epoll/kqueue/io_uring/poll
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
request.h File Reference
#include <stddef.h>
#include <string.h>
#include <strings.h>
Include dependency graph for request.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  KlParam
 
struct  KlRequest
 

Macros

#define KL_MAX_HEADERS   64
 Maximum number of request headers.
 
#define KL_MAX_PARAMS   16
 Maximum number of route parameters.
 

Typedefs

typedef struct KlBodyReader KlBodyReader
 Forward declaration — full definition in body_reader.h.
 
typedef struct KlRequest KlRequest
 
typedef struct KlConn KlConn
 Forward declaration — full definition in connection.h.
 

Functions

static KlConnkl_request_conn (const KlRequest *req)
 Typed accessor for the connection handle (preferred over raw _server_ctx).
 
static const char * kl_request_header (const KlRequest *req, const char *name)
 Find header by name (case-insensitive).
 
static const char * kl_request_header_len (const KlRequest *req, const char *name, size_t *out_len)
 Find header by name (case-insensitive).
 
static const char * kl_request_param (const KlRequest *req, const char *name, size_t *out_len)
 Find route parameter by name.
 

Macro Definition Documentation

◆ KL_MAX_HEADERS

#define KL_MAX_HEADERS   64

Maximum number of request headers.

◆ KL_MAX_PARAMS

#define KL_MAX_PARAMS   16

Maximum number of route parameters.

Typedef Documentation

◆ KlBodyReader

typedef struct KlBodyReader KlBodyReader

Forward declaration — full definition in body_reader.h.

◆ KlRequest

typedef struct KlRequest KlRequest

◆ KlConn

typedef struct KlConn KlConn

Forward declaration — full definition in connection.h.

Function Documentation

◆ kl_request_conn()

static KlConn * kl_request_conn ( const KlRequest req)
inlinestatic

Typed accessor for the connection handle (preferred over raw _server_ctx).

◆ kl_request_header()

static const char * kl_request_header ( const KlRequest req,
const char *  name 
)
inlinestatic

Find header by name (case-insensitive).

Returns
Null-terminated value pointer, or NULL if not found.

◆ kl_request_header_len()

static const char * kl_request_header_len ( const KlRequest req,
const char *  name,
size_t *  out_len 
)
inlinestatic

Find header by name (case-insensitive).

Returns
Value pointer (sets *out_len), or NULL if not found.

◆ kl_request_param()

static const char * kl_request_param ( const KlRequest req,
const char *  name,
size_t *  out_len 
)
inlinestatic

Find route parameter by name.

Returns
Value pointer (sets *out_len), or NULL if not found.