summaryrefslogtreecommitdiff
path: root/ot_http.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-10-27 19:15:22 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-10-27 19:15:22 +0100
commit8fb1c09df1540aa3fca1148bed6a08ffc3090669 (patch)
treeeb03f2a9f3eb8e074abc0533aac7f5ab7cd8926c /ot_http.c
parentdf5557705764d5e8f904a31d549fc037f5b1cf47 (diff)
All OSes now do have a cheap monotonic clock, so no caching thread is needed. Also add some relative time helpers
Diffstat (limited to 'ot_http.c')
-rw-r--r--ot_http.c6
1 files changed, 3 insertions, 3 deletions
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
222 cookie->flag &= ~STRUCT_HTTP_FLAG_CHUNKED_IN_TRANSFER; 222 cookie->flag &= ~STRUCT_HTTP_FLAG_CHUNKED_IN_TRANSFER;
223 } 223 }
224 224
225 fdstate_set_expiry(sock, g_now_seconds + OT_CLIENT_TIMEOUT_SEND); 225 fdstate_set_expiry(sock, time_future_seconds(OT_CLIENT_TIMEOUT_SEND));
226 http_interest_add(sock, cookie, EVENT_OUT); 226 http_interest_add(sock, cookie, EVENT_OUT);
227 return 0; 227 return 0;
228} 228}
@@ -359,7 +359,7 @@ static ssize_t http_handle_fullscrape(const int64_t sock, struct ot_workstruct *
359 ot_scrape_log this_peer, *new_peer; 359 ot_scrape_log this_peer, *new_peer;
360 int exactmatch; 360 int exactmatch;
361 memcpy(this_peer.ip, cookie->ip, sizeof(ot_ip6)); 361 memcpy(this_peer.ip, cookie->ip, sizeof(ot_ip6));
362 this_peer.last_fullscrape = g_now_seconds; 362 this_peer.last_fullscrape = time_now_seconds();
363 pthread_mutex_lock(&g_modest_fullscrape_mutex); 363 pthread_mutex_lock(&g_modest_fullscrape_mutex);
364 new_peer = vector_find_or_insert(&g_modest_fullscrape_timeouts, &this_peer, sizeof(ot_scrape_log), sizeof(ot_ip6), &exactmatch); 364 new_peer = vector_find_or_insert(&g_modest_fullscrape_timeouts, &this_peer, sizeof(ot_scrape_log), sizeof(ot_ip6), &exactmatch);
365 if (!new_peer) { 365 if (!new_peer) {
@@ -710,7 +710,7 @@ ssize_t http_handle_request(const int64_t sock, struct ot_workstruct *ws) {
710 log->size = ws->request_size; 710 log->size = ws->request_size;
711 log->data = malloc(ws->request_size); 711 log->data = malloc(ws->request_size);
712 log->next = 0; 712 log->next = 0;
713 log->time = g_now_seconds; 713 log->time = time_now_seconds();
714 memcpy(log->ip, cookie->ip, sizeof(ot_ip6)); 714 memcpy(log->ip, cookie->ip, sizeof(ot_ip6));
715 if (log->data) { 715 if (log->data) {
716 memcpy(log->data, ws->request, ws->request_size); 716 memcpy(log->data, ws->request, ws->request_size);