From 6cbd21542cf7a751e6f0f38864e7e9eae8fa3b14 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Tue, 27 Oct 2026 21:32:24 +0100 Subject: Plug in the new per-thread stats counter, also make sure that the ot_clean sleep does not stall tracker exit --- ot_http.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ot_http.c') diff --git a/ot_http.c b/ot_http.c index c4f74db..927d618 100644 --- a/ot_http.c +++ b/ot_http.c @@ -143,7 +143,7 @@ ssize_t http_issue_error(const int64_t sock, struct ot_workstruct *ws, int code) #ifdef _DEBUG_HTTPERROR fprintf(stderr, "DEBUG: invalid request was: %s\n", ws->debugbuf); #endif - stats_issue_event(EVENT_FAILED, FLAG_TCP, code); + stats_issue_event(ws, EVENT_FAILED, FLAG_TCP, code); http_senddata(sock, ws); return ws->reply_size = -2; } @@ -402,7 +402,7 @@ static ssize_t http_handle_fullscrape(const int64_t sock, struct ot_workstruct * #endif #endif - stats_issue_event(EVENT_FULLSCRAPE_REQUEST, 0, (uintptr_t)cookie->ip); + stats_issue_event(ws, EVENT_FULLSCRAPE_REQUEST, 0, (uintptr_t)cookie->ip); #ifdef _DEBUG_HTTPERROR fprintf(stderr, "%s", ws->debugbuf); @@ -474,7 +474,7 @@ static ssize_t http_handle_scrape(const int64_t sock, struct ot_workstruct *ws, /* Enough for http header + whole scrape string */ return_tcp_scrape_for_torrent((const ot_hash *)multiscrape_buf, numwant, &reply, ws->outbuf + G_OUTBUF_SIZE); ws->reply_size = reply - ws->reply; - stats_issue_event(EVENT_SCRAPE, FLAG_TCP, ws->reply_size); + stats_issue_event(ws, EVENT_SCRAPE, FLAG_TCP, ws->reply_size); return ws->reply_size; } @@ -682,7 +682,7 @@ static ssize_t http_handle_announce(const int64_t sock, struct ot_workstruct #endif /* XXX DEBUG - stats_issue_event( EVENT_ACCEPT, FLAG_TCP, (uintptr_t)ws->reply ); + stats_issue_event(ws, EVENT_ACCEPT, FLAG_TCP, (uintptr_t)ws->reply ); */ /* Scanned whole query string */ @@ -694,7 +694,7 @@ static ssize_t http_handle_announce(const int64_t sock, struct ot_workstruct else ws->reply_size = add_peer_to_torrent_and_return_peers(FLAG_TCP, ws, numwant); - stats_issue_event(EVENT_ANNOUNCE, FLAG_TCP, ws->reply_size); + stats_issue_event(ws, EVENT_ANNOUNCE, FLAG_TCP, ws->reply_size); return ws->reply_size; } -- cgit v1.3