cMCP 0.4.1
Model Context Protocol library in pure C11
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
cmcp_http_parser.h File Reference

Minimal HTTP/1.1 request-line + headers parser. More...

#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  cmcp_http_header_t
 
struct  cmcp_http_request_t
 

Macros

#define CMCP_HTTP_MAX_HEADERS   64
 

Functions

void cmcp_http_request_clear (cmcp_http_request_t *r)
 
const char * cmcp_http_header_get (const cmcp_http_request_t *r, const char *name)
 
int cmcp_http_parse_head (char *block, size_t body_offset, cmcp_http_request_t *out)
 

Detailed Description

Minimal HTTP/1.1 request-line + headers parser.

Extracted from src/transport_http.c into a standalone translation unit so the libFuzzer harness (fuzz/fuzz_http.c) can drive it directly without sockets. The parser deliberately does not understand transfer-encoding chunks or HTTP/2 — those belong to the transport layer's body-reading logic. Bounded buffers throughout; caps documented in src/transport_http.c.

Definition in file cmcp_http_parser.h.

Macro Definition Documentation

◆ CMCP_HTTP_MAX_HEADERS

#define CMCP_HTTP_MAX_HEADERS   64

Definition at line 17 of file cmcp_http_parser.h.

Function Documentation

◆ cmcp_http_request_clear()

void cmcp_http_request_clear ( cmcp_http_request_t r)

◆ cmcp_http_header_get()

const char * cmcp_http_header_get ( const cmcp_http_request_t r,
const char *  name 
)

◆ cmcp_http_parse_head()

int cmcp_http_parse_head ( char *  block,
size_t  body_offset,
cmcp_http_request_t out 
)