diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-25 22:56:34 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-25 22:56:34 +0100 |
| commit | 2e5b19945eb03fe4e3fa47562888401c7cbae71d (patch) | |
| tree | 45daefea693c483a943f3f205405b1019fe9e426 /opentracker.c | |
| parent | 0e3a2189f65354962fc71af41f5aa52261a782e8 (diff) | |
Factor out the timeout setter, will probably go later once we do the io loop ourself
Diffstat (limited to 'opentracker.c')
| -rw-r--r-- | opentracker.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/opentracker.c b/opentracker.c index 50fff29..60bdceb 100644 --- a/opentracker.c +++ b/opentracker.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include "ot_random.h" | 35 | #include "ot_random.h" |
| 36 | #include "ot_scan.h" | 36 | #include "ot_scan.h" |
| 37 | #include "ot_socket.h" | 37 | #include "ot_socket.h" |
| 38 | #include "ot_timeout.h" | ||
| 38 | #include "ot_stats.h" | 39 | #include "ot_stats.h" |
| 39 | #include "ot_udp.h" | 40 | #include "ot_udp.h" |
| 40 | #include "trackerlogic.h" | 41 | #include "trackerlogic.h" |
| @@ -204,7 +205,6 @@ static void handle_accept(const int64_t serversocket) { | |||
| 204 | int64_t sock; | 205 | int64_t sock; |
| 205 | ot_ip6 ip; | 206 | ot_ip6 ip; |
| 206 | uint16_t port; | 207 | uint16_t port; |
| 207 | tai6464 t; | ||
| 208 | 208 | ||
| 209 | while ((sock = socket_accept(serversocket, ip, &port)) != -1) { | 209 | while ((sock = socket_accept(serversocket, ip, &port)) != -1) { |
| 210 | 210 | ||
| @@ -223,11 +223,7 @@ static void handle_accept(const int64_t serversocket) { | |||
| 223 | 223 | ||
| 224 | stats_issue_event(EVENT_ACCEPT, FLAG_TCP, (uintptr_t)ip); | 224 | stats_issue_event(EVENT_ACCEPT, FLAG_TCP, (uintptr_t)ip); |
| 225 | 225 | ||
| 226 | /* That breaks taia encapsulation. But there is no way to take system | 226 | timeout_in(sock, OT_CLIENT_TIMEOUT); |
| 227 | time this often in FreeBSD and libowfat does not allow to set unix time */ | ||
| 228 | taia_uint(&t, 0); /* Clear t */ | ||
| 229 | tai_unix(&(t.sec), (g_now_seconds + OT_CLIENT_TIMEOUT)); | ||
| 230 | io_timeout(sock, t); | ||
| 231 | } | 227 | } |
| 232 | io_eagain(serversocket); | 228 | io_eagain(serversocket); |
| 233 | } | 229 | } |
