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. --- examples/async/main.c | 6 +++--- examples/headers/main.c | 6 +++--- examples/hello/main.c | 6 +++--- examples/put/main.c | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'examples') diff --git a/examples/async/main.c b/examples/async/main.c index fbd766e..8b0ec82 100644 --- a/examples/async/main.c +++ b/examples/async/main.c @@ -120,9 +120,9 @@ static int hello(const struct http_payload *const pl, 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) { *r = (const struct http_response) { diff --git a/examples/headers/main.c b/examples/headers/main.c index a4eb5e6..b9ed388 100644 --- a/examples/headers/main.c +++ b/examples/headers/main.c @@ -40,9 +40,9 @@ static int hello(const struct http_payload *const pl, 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) { *r = (const struct http_response) { diff --git a/examples/hello/main.c b/examples/hello/main.c index 8ddf691..cb5a8ee 100644 --- a/examples/hello/main.c +++ b/examples/hello/main.c @@ -77,9 +77,9 @@ end: return ret; } -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) { *r = (const struct http_response) { diff --git a/examples/put/main.c b/examples/put/main.c index 3d6454d..562a1fa 100644 --- a/examples/put/main.c +++ b/examples/put/main.c @@ -40,9 +40,9 @@ static int on_put(const struct http_payload *const pl, 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) { *r = (const struct http_response) { -- cgit v1.2.3