From 87807c690947f4636dc4dd7fddca15f944719f0c Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Thu, 12 Feb 2026 16:59:55 +0100 Subject: Add HTTP op and resource to length callback Users might want to know which HTTP operation (i.e., POST or PUT) and/or resource is being requested before determining whether the request should be accepted or not. --- doc/man7/libweb_handler.7 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/man7/libweb_handler.7') diff --git a/doc/man7/libweb_handler.7 b/doc/man7/libweb_handler.7 index 5398675..6a2c93e 100644 --- a/doc/man7/libweb_handler.7 +++ b/doc/man7/libweb_handler.7 @@ -73,7 +73,7 @@ defined as: struct handler_cfg { const char *\fItmpdir\fP; - int (*\fIlength\fP)(unsigned long long len, const struct http_cookie *c, struct http_response *r, void *user); + int (*\fIlength\fP)(enum http_op op, const char *res, unsigned long long len, const struct http_cookie *c, struct http_response *r, void *user); void *\fIuser\fP; size_t \fImax_headers\fP; struct http_cfg_post \fIpost\fP; @@ -185,7 +185,7 @@ static int hello(const struct http_payload *const pl, return 0; } -static int on_length(const unsigned long long len, +static int on_length(const char *const res, const unsigned long long len, const struct http_cookie *const c, struct http_response *const r, void *const user) { -- cgit v1.2.3