diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-11-07 23:03:56 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2023-11-07 23:03:56 +0000 |
commit | 4eda14316376fb1e657ac2da269533e2422d2399 (patch) | |
tree | ef7bbc29a69e975a132b4473b75c71ddebfc4404 /src/tipideed/trace.c | |
parent | c5e284cb04dc542355ae04f604fd0edb69ff689e (diff) | |
download | tipidee-4eda14316376fb1e657ac2da269533e2422d2399.tar.xz |
Prepare for 0.0.1.1. Minor code cleanups.
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/tipideed/trace.c')
-rw-r--r-- | src/tipideed/trace.c | 12 |
1 files changed, 6 insertions, 6 deletions
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 <tipidee/log.h> #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 |