From e77bd93693a74ce872d4c13fb45537c34518d84f Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Mon, 6 Oct 2025 23:01:42 +0200 Subject: Implement HTTP chunk encoding A new function pointer, namely chunk, has been added to struct http_response so that library users can generate their message bodies dynamically. --- include/libweb/http.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/libweb/http.h b/include/libweb/http.h index 87edf8a..dab19df 100644 --- a/include/libweb/http.h +++ b/include/libweb/http.h @@ -109,14 +109,15 @@ struct http_response unsigned long long n; size_t n_headers; void (*free)(void *); - void *step_args; + void *args; + int (*chunk)(void *buf, size_t n, bool *done, void *user, void *args); union http_step { int (*length)(unsigned long long len, const struct http_cookie *c, - struct http_response *r, void *user, void *step_args); + struct http_response *r, void *user, void *args); int (*payload)(const struct http_payload *p, struct http_response *r, - void *user, void *step_args); + void *user, void *args); } step; }; -- cgit v1.2.3