summaryrefslogtreecommitdiff
path: root/ot_fdstate.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-10-30 23:11:41 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-10-30 23:11:41 +0100
commit15f9f81b5a8398fefca023e90d8d1c168ecef620 (patch)
tree5661bcf9e01ea89784de285ae27312a1e752167d /ot_fdstate.c
parent36e396fd30bf098fa2459f11f4dd4430f7a8396e (diff)
Introduce a fast path assuming that a tcp connection's payload already has arrived at accept time
Diffstat (limited to 'ot_fdstate.c')
-rw-r--r--ot_fdstate.c7
1 files changed, 7 insertions, 0 deletions
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) {
186 return slot ? atomic_load_explicit(&slot->cookie, memory_order_relaxed) : NULL; 186 return slot ? atomic_load_explicit(&slot->cookie, memory_order_relaxed) : NULL;
187} 187}
188 188
189void fdstate_set_cookie(int fd, void *cookie) {
190 ot_fdslot *slot = fdstate_slot(fd);
191
192 if (slot)
193 atomic_store_explicit(&slot->cookie, cookie, memory_order_relaxed);
194}
195
189void fdstate_set_expiry(int fd, ot_time expiry) { 196void fdstate_set_expiry(int fd, ot_time expiry) {
190 ot_fdslot *slot = fdstate_slot(fd); 197 ot_fdslot *slot = fdstate_slot(fd);
191 198