feat(daemon): add shared cross-process connection registry
The daemon forks one child per accepted connection, so per-module and per-source accounting must live in state shared across the children. Add a fixed-size registry carved from an anonymous shared mapping (mmap(MAP_SHARED|MAP_ANONYMOUS)) created before the accept loop: a slot lifecycle (FREE/CLAIMED/REGISTERED) with parent claim/reclaim and a lock-free, open-addressed per-source table for the per-host occupancy and the shared auth-failure counter. C11 atomics only; no pthread locks across fork. Unit tests cover slot exhaustion, the module/host caps, pid reclaim and fork-shared visibility.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
#ifndef TEST_DAEMON_LIMITS_H
|
||||
#define TEST_DAEMON_LIMITS_H
|
||||
|
||||
void test_daemon_limits();
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user