KEEL 1.0.0
Minimal C11 HTTP client/server library built on epoll/kqueue/io_uring/poll
Loading...
Searching...
No Matches
Data Fields
KlBufReader Struct Reference

Built-in buffer reader — accumulates body into a growable buffer. More...

#include <body_reader.h>

Collaboration diagram for KlBufReader:
Collaboration graph
[legend]

Data Fields

KlBodyReader base
 
KlAllocatoralloc
 
char * data
 
size_t len
 
size_t cap
 
size_t max_size
 

Detailed Description

Built-in buffer reader — accumulates body into a growable buffer.

Pass max_size as user_data via cast: (void *)(size_t)max_size. Pass NULL (0) for unlimited. Exceeding max_size returns -1 from on_data, which aborts the parse and sends 413.

Field Documentation

◆ base

KlBodyReader KlBufReader::base

Base body reader vtable

◆ alloc

KlAllocator* KlBufReader::alloc

Allocator for buffer growth

◆ data

char* KlBufReader::data

Accumulated body data

◆ len

size_t KlBufReader::len

Current data length

◆ cap

size_t KlBufReader::cap

Buffer capacity

◆ max_size

size_t KlBufReader::max_size

0 = unlimited


The documentation for this struct was generated from the following file: