From 15f9f81b5a8398fefca023e90d8d1c168ecef620 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Fri, 30 Oct 2026 23:11:41 +0100 Subject: Introduce a fast path assuming that a tcp connection's payload already has arrived at accept time --- ot_fdstate.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ot_fdstate.c') diff --git a/ot_fdstate.c b/ot_fdstate.c index 537bcb0..7d742da 100644 --- a/ot_fdstate.c +++ b/ot_fdstate.c @@ -186,6 +186,13 @@ void *fdstate_cookie(int fd) { return slot ? atomic_load_explicit(&slot->cookie, memory_order_relaxed) : NULL; } +void fdstate_set_cookie(int fd, void *cookie) { + ot_fdslot *slot = fdstate_slot(fd); + + if (slot) + atomic_store_explicit(&slot->cookie, cookie, memory_order_relaxed); +} + void fdstate_set_expiry(int fd, ot_time expiry) { ot_fdslot *slot = fdstate_slot(fd); -- cgit v1.3