diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-06-25 14:23:33 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-06-25 14:23:33 +0200 |
| commit | 84f2ed55fdb2ff936be0e28a5ed24971b4ce4817 (patch) | |
| tree | c5eec5e3f0a17c7f553cedd3516fdc56c9b53ebb /tools/server | |
| parent | 7874e111847a521ad08f5d94b2422d0362c6f5f9 (diff) | |
| download | ffwd-84f2ed55fdb2ff936be0e28a5ed24971b4ce4817.tar.gz ffwd-84f2ed55fdb2ff936be0e28a5ed24971b4ce4817.zip | |
server: move the request body instead of copying it
Diffstat (limited to 'tools/server')
| -rw-r--r-- | tools/server/server.c | 5 |
1 files 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 |
