From 5a6f30440b66fe6713acb9d979dc3e6624e4c36a Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Tue, 23 Sep 2025 22:03:57 +0200 Subject: Implement async HTTP responses Sometimes, library users cannot return a HTTP response as soon as the request is received, or the operations that are required to generate it can take a long time. In order to solve this, libweb adds a new member to struct http_response, namely step, which must be assigned to a function whenever a HTTP response should be generated in a non-blocking manner. Leaving the function pointer as null will fall back to the default behaviour. --- include/libweb/http.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/libweb/http.h b/include/libweb/http.h index 736a561..f18b5c4 100644 --- a/include/libweb/http.h +++ b/include/libweb/http.h @@ -109,6 +109,7 @@ struct http_response unsigned long long n; size_t n_headers; void (*free)(void *); + int (*step)(const struct http_payload *, struct http_response *, void *); }; struct http_cfg -- cgit v1.2.3