From 4eda14316376fb1e657ac2da269533e2422d2399 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 7 Nov 2023 23:03:56 +0000 Subject: Prepare for 0.0.1.1. Minor code cleanups. Signed-off-by: Laurent Bercot --- src/tipideed/trace.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/tipideed/trace.c') diff --git a/src/tipideed/trace.c b/src/tipideed/trace.c index d1aed09..0e2ccac 100644 --- a/src/tipideed/trace.c +++ b/src/tipideed/trace.c @@ -13,7 +13,7 @@ #include #include "tipideed-internal.h" -int respond_trace (char const *buf, tipidee_rql const *rql, tipidee_headers const *hdr) +int respond_trace (tipidee_rql const *rql, tipidee_headers const *hdr) { tain deadline ; size_t cl = 0 ; @@ -26,7 +26,7 @@ int respond_trace (char const *buf, tipidee_rql const *rql, tipidee_headers cons cl += strlen(rql->uri.path) + (rql->uri.query ? 1 + strlen(rql->uri.query) : 0) ; cl += 6 + uint_fmt(0, rql->http_major) + 1 + uint_fmt(0, rql->http_minor) + 2 ; for (size_t i = 0 ; i < hdr->n ; i++) - cl += strlen(buf + hdr->list[i].left) + 2 + strlen(buf + hdr->list[i].right) + 2 ; + cl += strlen(hdr->buf + hdr->list[i].left) + 2 + strlen(hdr->buf + hdr->list[i].right) + 2 ; cl += 2 ; buffer_putnoflush(buffer_1, fmt, size_fmt(fmt, cl)) ; buffer_putsnoflush(buffer_1, "\r\n\r\n") ; @@ -52,12 +52,12 @@ int respond_trace (char const *buf, tipidee_rql const *rql, tipidee_headers cons tipidee_log_answer(g.logv, rql, 200, cl) ; for (size_t i = 0 ; i < hdr->n ; i++) { - size_t len = strlen(buf + hdr->list[i].left) ; + size_t len = strlen(hdr->buf + hdr->list[i].left) ; tain_add_g(&deadline, &g.writetto) ; - if (buffer_timed_put_g(buffer_1, buf + hdr->list[i].left, len, &deadline) < len) goto err ; + if (buffer_timed_put_g(buffer_1, hdr->buf + hdr->list[i].left, len, &deadline) < len) goto err ; if (buffer_timed_put_g(buffer_1, ": ", 2, &deadline) < 2) goto err ; - len = strlen(buf + hdr->list[i].right) ; - if (buffer_timed_put_g(buffer_1, buf + hdr->list[i].right, len, &deadline) < len) goto err ; + len = strlen(hdr->buf + hdr->list[i].right) ; + if (buffer_timed_put_g(buffer_1, hdr->buf + hdr->list[i].right, len, &deadline) < len) goto err ; if (buffer_timed_put_g(buffer_1, "\r\n", 2, &deadline) < 2) goto err ; } if (buffer_timed_put_g(buffer_1, "\r\n", 2, &deadline) < 2 -- cgit v1.2.3