summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2024-04-15 16:38:37 +0200
committerDirk Engling <erdgeist@erdgeist.org>2024-04-15 16:38:37 +0200
commita4161f911f880f22e101fb2e4cffd8c35cded008 (patch)
treec741dfe1dfb028befbd93053ee310168f3dccccf
parente0cd3b18313584eb717dfe99f65d3d90fe0885c9 (diff)
Use bzero instead of the new iob_init for older libowfats
-rw-r--r--ot_http.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ot_http.c b/ot_http.c
index ddb3e81..df3a1ae 100644
--- a/ot_http.c
+++ b/ot_http.c
@@ -31,9 +31,9 @@
31#include "trackerlogic.h" 31#include "trackerlogic.h"
32 32
33#ifdef WANT_NO_AUTO_FREE 33#ifdef WANT_NO_AUTO_FREE
34#define OT_IOB_INIT iob_init 34#define OT_IOB_INIT(B) bzero(B, sizeof(io_batch))
35#else 35#else
36#define OT_IOB_INIT iob_init_autofree 36#define OT_IOB_INIT(B) iob_init_autofree(B, 0)
37#endif 37#endif
38 38
39#define OT_MAXMULTISCRAPE_COUNT 64 39#define OT_MAXMULTISCRAPE_COUNT 64
@@ -87,7 +87,7 @@ static void http_senddata(const int64 sock, struct ot_workstruct *ws) {
87 memcpy(outbuf, ws->reply + written_size, ws->reply_size - written_size); 87 memcpy(outbuf, ws->reply + written_size, ws->reply_size - written_size);
88 if (!cookie->batch) { 88 if (!cookie->batch) {
89 cookie->batch = malloc(sizeof(io_batch)); 89 cookie->batch = malloc(sizeof(io_batch));
90 OT_IOB_INIT(cookie->batch, 0); 90 OT_IOB_INIT(cookie->batch);
91 cookie->batches = 1; 91 cookie->batches = 1;
92 } 92 }
93 93
@@ -185,7 +185,7 @@ ssize_t http_sendiovecdata(const int64 sock, struct ot_workstruct *ws, int iovec
185 iovec_free(&iovec_entries, &iovector); 185 iovec_free(&iovec_entries, &iovector);
186 HTTPERROR_500; 186 HTTPERROR_500;
187 } 187 }
188 OT_IOB_INIT(cookie->batch, 0); 188 OT_IOB_INIT(cookie->batch);
189 cookie->batches = 1; 189 cookie->batches = 1;
190 } 190 }
191 current = cookie->batch + cookie->batches - 1; 191 current = cookie->batch + cookie->batches - 1;
@@ -199,7 +199,7 @@ ssize_t http_sendiovecdata(const int64 sock, struct ot_workstruct *ws, int iovec
199 if (new_batch) { 199 if (new_batch) {
200 cookie->batch = new_batch; 200 cookie->batch = new_batch;
201 current = cookie->batch + cookie->batches++; 201 current = cookie->batch + cookie->batches++;
202 OT_IOB_INIT(current, 0); 202 OT_IOB_INIT(current);
203 } 203 }
204 } 204 }
205 iob_addbuf_free(current, iovector[i].iov_base, iovector[i].iov_len); 205 iob_addbuf_free(current, iovector[i].iov_base, iovector[i].iov_len);