|
cMCP 0.4.1
Model Context Protocol library in pure C11
|
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) |
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.
| #define CMCP_HTTP_MAX_HEADERS 64 |
Definition at line 17 of file cmcp_http_parser.h.
| 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 | ||
| ) |