diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-10-06 23:01:42 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-10-08 01:57:42 +0200 |
| commit | e77bd93693a74ce872d4c13fb45537c34518d84f (patch) | |
| tree | 8fb265064ebf9debed2e797cbdef42187524d158 /include | |
| parent | db9cb051c4ee05c07ab32dfed5bae8b7dc0916bd (diff) | |
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.
Diffstat (limited to 'include')
| -rw-r--r-- | include/libweb/http.h | 7 |
1 files changed, 4 insertions, 3 deletions
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; }; |
