From 8bae93ce181086769175e5c3fb0f0ef66fb9ca89 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Fri, 6 Nov 2026 03:01:46 +0100 Subject: Stop reading a connection a worker has taken over --- src/ot_http.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ot_http.c') diff --git a/src/ot_http.c b/src/ot_http.c index e6a8db7..29f41a3 100644 --- a/src/ot_http.c +++ b/src/ot_http.c @@ -367,6 +367,7 @@ static ssize_t http_handle_stats(const int64_t sock, struct ot_workstruct *ws, c a home of its own and only then be made reachable by a worker thread */ if (!http_adopt(sock)) HTTPERROR_500; + ws->handed_off = 1; fullscrape_deliver(sock, format); return ws->reply_size = -2; } @@ -383,6 +384,7 @@ static ssize_t http_handle_stats(const int64_t sock, struct ot_workstruct *ws, c if (!http_adopt(sock)) HTTPERROR_500; + ws->handed_off = 1; stats_deliver(sock, mode); return ws->reply_size = -2; } @@ -477,6 +479,7 @@ static ssize_t http_handle_fullscrape(const int64_t sock, struct ot_workstruct * if (!http_adopt(sock)) HTTPERROR_500; + ws->handed_off = 1; fullscrape_deliver(sock, format); return ws->reply_size = -2; } @@ -742,6 +745,7 @@ ssize_t http_handle_request(const int64_t sock, struct ot_workstruct *ws) { subroutine gets to answer: an error reply finishes with the connection on its way out, and ws outlives the connection it was serving */ ws->keep_alive = 0; + ws->handed_off = 0; #ifdef WANT_KEEPALIVE if ((write_ptr = http_header(ws->request, ws->header_size, "connection")) && (*write_ptr == 'K' || *write_ptr == 'k')) ws->keep_alive = 1; -- cgit v1.3