summaryrefslogtreecommitdiff
path: root/src/ot_http.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-11-06 03:01:46 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-11-06 03:01:46 +0100
commit8bae93ce181086769175e5c3fb0f0ef66fb9ca89 (patch)
treeda86b766bd37f1a71d0847fd3ebbd93b1f95ec76 /src/ot_http.c
parent2cecc9da20afb55613589dafc854e9f4d1a74069 (diff)
Stop reading a connection a worker has taken over
Diffstat (limited to 'src/ot_http.c')
-rw-r--r--src/ot_http.c4
1 files changed, 4 insertions, 0 deletions
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
367 a home of its own and only then be made reachable by a worker thread */ 367 a home of its own and only then be made reachable by a worker thread */
368 if (!http_adopt(sock)) 368 if (!http_adopt(sock))
369 HTTPERROR_500; 369 HTTPERROR_500;
370 ws->handed_off = 1;
370 fullscrape_deliver(sock, format); 371 fullscrape_deliver(sock, format);
371 return ws->reply_size = -2; 372 return ws->reply_size = -2;
372 } 373 }
@@ -383,6 +384,7 @@ static ssize_t http_handle_stats(const int64_t sock, struct ot_workstruct *ws, c
383 384
384 if (!http_adopt(sock)) 385 if (!http_adopt(sock))
385 HTTPERROR_500; 386 HTTPERROR_500;
387 ws->handed_off = 1;
386 stats_deliver(sock, mode); 388 stats_deliver(sock, mode);
387 return ws->reply_size = -2; 389 return ws->reply_size = -2;
388 } 390 }
@@ -477,6 +479,7 @@ static ssize_t http_handle_fullscrape(const int64_t sock, struct ot_workstruct *
477 479
478 if (!http_adopt(sock)) 480 if (!http_adopt(sock))
479 HTTPERROR_500; 481 HTTPERROR_500;
482 ws->handed_off = 1;
480 fullscrape_deliver(sock, format); 483 fullscrape_deliver(sock, format);
481 return ws->reply_size = -2; 484 return ws->reply_size = -2;
482} 485}
@@ -742,6 +745,7 @@ ssize_t http_handle_request(const int64_t sock, struct ot_workstruct *ws) {
742 subroutine gets to answer: an error reply finishes with the connection 745 subroutine gets to answer: an error reply finishes with the connection
743 on its way out, and ws outlives the connection it was serving */ 746 on its way out, and ws outlives the connection it was serving */
744 ws->keep_alive = 0; 747 ws->keep_alive = 0;
748 ws->handed_off = 0;
745#ifdef WANT_KEEPALIVE 749#ifdef WANT_KEEPALIVE
746 if ((write_ptr = http_header(ws->request, ws->header_size, "connection")) && (*write_ptr == 'K' || *write_ptr == 'k')) 750 if ((write_ptr = http_header(ws->request, ws->header_size, "connection")) && (*write_ptr == 'K' || *write_ptr == 'k'))
747 ws->keep_alive = 1; 751 ws->keep_alive = 1;