From e77bd93693a74ce872d4c13fb45537c34518d84f Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Mon, 6 Oct 2025 23:01:42 +0200 Subject: 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. --- handler.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'handler.c') diff --git a/handler.c b/handler.c index 63ef726..f30cfc3 100644 --- a/handler.c +++ b/handler.c @@ -29,7 +29,7 @@ struct handler struct server_client *c; struct http_ctx *http; union http_step step; - void *step_args; + void *args; struct client *next; } *clients; @@ -66,14 +66,14 @@ static int on_payload(const struct http_payload *const p, int ret; if (s->payload) - ret = s->payload(p, r, e->user, c->step_args); + ret = s->payload(p, r, e->user, c->args); else ret = e->f(p, r, e->user); if (!ret) { s->payload = r->step.payload; - c->step_args = r->step_args; + c->args = r->args; } return ret; @@ -104,14 +104,14 @@ static int on_length(const unsigned long long len, int ret; if (s->length) - ret = s->length(len, c, r, h->cfg.user, cl->step_args); + ret = s->length(len, c, r, h->cfg.user, cl->args); else ret = h->cfg.length(len, c, r, h->cfg.user); if (!ret) { s->length = r->step.length; - cl->step_args = r->step_args; + cl->args = r->args; } return ret; -- cgit v1.2.3