From 84f2ed55fdb2ff936be0e28a5ed24971b4ce4817 Mon Sep 17 00:00:00 2001 From: Onur Gündüz Date: Thu, 25 Jun 2026 14:23:33 +0200 Subject: server: move the request body instead of copying it --- tools/server/server.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/server/server.c b/tools/server/server.c index 40b8e18..2bf7153 100644 --- a/tools/server/server.c +++ b/tools/server/server.c @@ -99,9 +99,10 @@ void dispatch_request(client *c) { j->c = c; snprintf(j->method, sizeof(j->method), "%s", c->req.method); snprintf(j->path, sizeof(j->path), "%s", c->req.path); - j->body = xstrndup(c->req.body ? c->req.body : "", c->req.body_len); + j->body = c->req.body; j->body_len = c->req.body_len; - j->auth = c->req.auth ? xstrdup(c->req.auth) : NULL; + c->req.body = NULL; + c->req.body_len = 0; j->created_ns = nstime(); client_incref(c); /* All requests go through the tokenizer thread. Tokenization must run on a -- cgit v1.3.1