summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-10-24 12:33:04 +0200
committerDirk Engling <erdgeist@erdgeist.org>2026-10-24 12:33:04 +0200
commit1b97919d03ab55d4e0be05f4700b5b80ece4e5cc (patch)
treed55da3fb24f86682d2d50bdd5c38aebc7f7103c2
parent656be1fee7b3a9307458a098efbe7ebc9de305c5 (diff)
Initialise workstruct for each read, so that stale entries will not linger in http error cases
-rw-r--r--opentracker.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/opentracker.c b/opentracker.c
index bcc075c..0ae98e6 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -183,6 +183,11 @@ static void handle_read(const int64 sock, struct ot_workstruct *ws) {
183 if (byte_count == -1) 183 if (byte_count == -1)
184 return; 184 return;
185 185
186 ws->request = NULL;
187 ws->request_size = 0;
188 ws->header_size = 0;
189 ws->keep_alive = 0;
190
186 /* If we get the whole request in one packet, handle it without copying */ 191 /* If we get the whole request in one packet, handle it without copying */
187 if (!array_start(&cookie->request)) { 192 if (!array_start(&cookie->request)) {
188 if ((ws->header_size = header_complete(ws->inbuf, byte_count))) { 193 if ((ws->header_size = header_complete(ws->inbuf, byte_count))) {