aboutsummaryrefslogtreecommitdiff
path: root/handler.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2026-02-12 16:59:55 +0100
committerXavier Del Campo Romero <xavi92@disroot.org>2026-02-12 16:59:55 +0100
commit87807c690947f4636dc4dd7fddca15f944719f0c (patch)
tree0696d61b91a3e5f40a34cf09ac6c715584af5744 /handler.c
parent16f07314e675dd7d9d9cfb44dfb33cd81b13590d (diff)
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.
Diffstat (limited to 'handler.c')
-rw-r--r--handler.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/handler.c b/handler.c
index 455832b..a7f0303 100644
--- a/handler.c
+++ b/handler.c
@@ -93,9 +93,9 @@ static int on_payload(const struct http_payload *const p,
return 0;
}
-static int on_length(const unsigned long long len,
- const struct http_cookie *const c, struct http_response *const r,
- void *const user)
+static int on_length(const enum http_op op, const char *const res,
+ const unsigned long long len, const struct http_cookie *const c,
+ struct http_response *const r, void *const user)
{
struct client *const cl = user;
struct handler *const h = cl->h;
@@ -107,9 +107,9 @@ static int on_length(const unsigned long long len,
int ret;
if (s->length)
- ret = s->length(len, c, r, h->cfg.user, cl->args);
+ ret = s->length(op, res, len, c, r, h->cfg.user, cl->args);
else
- ret = h->cfg.length(len, c, r, h->cfg.user);
+ ret = h->cfg.length(op, res, len, c, r, h->cfg.user);
if (!ret)
{