summaryrefslogtreecommitdiff
path: root/ot_http.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-10-27 21:32:24 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-10-27 21:32:24 +0100
commit6cbd21542cf7a751e6f0f38864e7e9eae8fa3b14 (patch)
treeb5416c7e6ad2ac30cfe51559f69c122ed493450d /ot_http.c
parente1d7b7771e915a01b5f1dd12664a6ac7fb397dfb (diff)
Plug in the new per-thread stats counter, also make sure that the ot_clean sleep does not stall tracker exit
Diffstat (limited to 'ot_http.c')
-rw-r--r--ot_http.c10
1 files changed, 5 insertions, 5 deletions
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)
143#ifdef _DEBUG_HTTPERROR 143#ifdef _DEBUG_HTTPERROR
144 fprintf(stderr, "DEBUG: invalid request was: %s\n", ws->debugbuf); 144 fprintf(stderr, "DEBUG: invalid request was: %s\n", ws->debugbuf);
145#endif 145#endif
146 stats_issue_event(EVENT_FAILED, FLAG_TCP, code); 146 stats_issue_event(ws, EVENT_FAILED, FLAG_TCP, code);
147 http_senddata(sock, ws); 147 http_senddata(sock, ws);
148 return ws->reply_size = -2; 148 return ws->reply_size = -2;
149} 149}
@@ -402,7 +402,7 @@ static ssize_t http_handle_fullscrape(const int64_t sock, struct ot_workstruct *
402#endif 402#endif
403#endif 403#endif
404 404
405 stats_issue_event(EVENT_FULLSCRAPE_REQUEST, 0, (uintptr_t)cookie->ip); 405 stats_issue_event(ws, EVENT_FULLSCRAPE_REQUEST, 0, (uintptr_t)cookie->ip);
406 406
407#ifdef _DEBUG_HTTPERROR 407#ifdef _DEBUG_HTTPERROR
408 fprintf(stderr, "%s", ws->debugbuf); 408 fprintf(stderr, "%s", ws->debugbuf);
@@ -474,7 +474,7 @@ static ssize_t http_handle_scrape(const int64_t sock, struct ot_workstruct *ws,
474 /* Enough for http header + whole scrape string */ 474 /* Enough for http header + whole scrape string */
475 return_tcp_scrape_for_torrent((const ot_hash *)multiscrape_buf, numwant, &reply, ws->outbuf + G_OUTBUF_SIZE); 475 return_tcp_scrape_for_torrent((const ot_hash *)multiscrape_buf, numwant, &reply, ws->outbuf + G_OUTBUF_SIZE);
476 ws->reply_size = reply - ws->reply; 476 ws->reply_size = reply - ws->reply;
477 stats_issue_event(EVENT_SCRAPE, FLAG_TCP, ws->reply_size); 477 stats_issue_event(ws, EVENT_SCRAPE, FLAG_TCP, ws->reply_size);
478 return ws->reply_size; 478 return ws->reply_size;
479} 479}
480 480
@@ -682,7 +682,7 @@ static ssize_t http_handle_announce(const int64_t sock, struct ot_workstruct
682#endif 682#endif
683 683
684 /* XXX DEBUG 684 /* XXX DEBUG
685 stats_issue_event( EVENT_ACCEPT, FLAG_TCP, (uintptr_t)ws->reply ); 685 stats_issue_event(ws, EVENT_ACCEPT, FLAG_TCP, (uintptr_t)ws->reply );
686 */ 686 */
687 687
688 /* Scanned whole query string */ 688 /* Scanned whole query string */
@@ -694,7 +694,7 @@ static ssize_t http_handle_announce(const int64_t sock, struct ot_workstruct
694 else 694 else
695 ws->reply_size = add_peer_to_torrent_and_return_peers(FLAG_TCP, ws, numwant); 695 ws->reply_size = add_peer_to_torrent_and_return_peers(FLAG_TCP, ws, numwant);
696 696
697 stats_issue_event(EVENT_ANNOUNCE, FLAG_TCP, ws->reply_size); 697 stats_issue_event(ws, EVENT_ANNOUNCE, FLAG_TCP, ws->reply_size);
698 return ws->reply_size; 698 return ws->reply_size;
699} 699}
700 700