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

Go to the source code of this file.

Data Structures

struct  KlMultipartPart
 
struct  KlMultipartConfig
 
struct  KlMultipartReader
 

Macros

#define KL_MP_MAX_BOUNDARY   70
 

Enumerations

enum  KlMultipartState {
  KL_MP_PREAMBLE , KL_MP_AFTER_BOUNDARY , KL_MP_HEADERS , KL_MP_BODY ,
  KL_MP_DONE , KL_MP_ERROR
}
 

Functions

KlBodyReaderkl_body_reader_multipart (KlAllocator *alloc, const KlRequest *req, void *user_data)
 Factory: create a multipart/form-data body reader.
 

Macro Definition Documentation

◆ KL_MP_MAX_BOUNDARY

#define KL_MP_MAX_BOUNDARY   70

RFC 2046

Enumeration Type Documentation

◆ KlMultipartState

Enumerator
KL_MP_PREAMBLE 
KL_MP_AFTER_BOUNDARY 

boundary found, waiting for CRLF or –

KL_MP_HEADERS 
KL_MP_BODY 
KL_MP_DONE 
KL_MP_ERROR 

Function Documentation

◆ kl_body_reader_multipart()

KlBodyReader * kl_body_reader_multipart ( KlAllocator alloc,
const KlRequest req,
void *  user_data 
)

Factory: create a multipart/form-data body reader.

Extracts the boundary from Content-Type. Returns NULL (triggering 415) if the content type is not multipart/form-data or has no boundary.

Parameters
allocAllocator for parts and buffers.
reqParsed request (Content-Type must be set).
user_dataKlMultipartConfig pointer, or NULL for defaults.
Returns
Multipart body reader, or NULL on rejection.