From 8fb1c09df1540aa3fca1148bed6a08ffc3090669 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Tue, 27 Oct 2026 19:15:22 +0100 Subject: All OSes now do have a cheap monotonic clock, so no caching thread is needed. Also add some relative time helpers --- ot_http.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ot_http.c') diff --git a/ot_http.c b/ot_http.c index 2216453..c4f74db 100644 --- a/ot_http.c +++ b/ot_http.c @@ -222,7 +222,7 @@ ssize_t http_sendiovecdata(const int64_t sock, struct ot_workstruct *ws, size_t cookie->flag &= ~STRUCT_HTTP_FLAG_CHUNKED_IN_TRANSFER; } - fdstate_set_expiry(sock, g_now_seconds + OT_CLIENT_TIMEOUT_SEND); + fdstate_set_expiry(sock, time_future_seconds(OT_CLIENT_TIMEOUT_SEND)); http_interest_add(sock, cookie, EVENT_OUT); return 0; } @@ -359,7 +359,7 @@ static ssize_t http_handle_fullscrape(const int64_t sock, struct ot_workstruct * ot_scrape_log this_peer, *new_peer; int exactmatch; memcpy(this_peer.ip, cookie->ip, sizeof(ot_ip6)); - this_peer.last_fullscrape = g_now_seconds; + this_peer.last_fullscrape = time_now_seconds(); pthread_mutex_lock(&g_modest_fullscrape_mutex); new_peer = vector_find_or_insert(&g_modest_fullscrape_timeouts, &this_peer, sizeof(ot_scrape_log), sizeof(ot_ip6), &exactmatch); if (!new_peer) { @@ -710,7 +710,7 @@ ssize_t http_handle_request(const int64_t sock, struct ot_workstruct *ws) { log->size = ws->request_size; log->data = malloc(ws->request_size); log->next = 0; - log->time = g_now_seconds; + log->time = time_now_seconds(); memcpy(log->ip, cookie->ip, sizeof(ot_ip6)); if (log->data) { memcpy(log->data, ws->request, ws->request_size); -- cgit v1.3