From 2e5b19945eb03fe4e3fa47562888401c7cbae71d Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sun, 25 Oct 2026 22:56:34 +0100 Subject: Factor out the timeout setter, will probably go later once we do the io loop ourself --- opentracker.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'opentracker.c') diff --git a/opentracker.c b/opentracker.c index 50fff29..60bdceb 100644 --- a/opentracker.c +++ b/opentracker.c @@ -35,6 +35,7 @@ #include "ot_random.h" #include "ot_scan.h" #include "ot_socket.h" +#include "ot_timeout.h" #include "ot_stats.h" #include "ot_udp.h" #include "trackerlogic.h" @@ -204,7 +205,6 @@ static void handle_accept(const int64_t serversocket) { int64_t sock; ot_ip6 ip; uint16_t port; - tai6464 t; while ((sock = socket_accept(serversocket, ip, &port)) != -1) { @@ -223,11 +223,7 @@ static void handle_accept(const int64_t serversocket) { stats_issue_event(EVENT_ACCEPT, FLAG_TCP, (uintptr_t)ip); - /* That breaks taia encapsulation. But there is no way to take system - time this often in FreeBSD and libowfat does not allow to set unix time */ - taia_uint(&t, 0); /* Clear t */ - tai_unix(&(t.sec), (g_now_seconds + OT_CLIENT_TIMEOUT)); - io_timeout(sock, t); + timeout_in(sock, OT_CLIENT_TIMEOUT); } io_eagain(serversocket); } -- cgit v1.3