mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-11 09:25:35 +08:00
Create the graph UI listener with SOCK_CLOEXEC on Linux and accept connections with accept4(SOCK_CLOEXEC). Verify FD_CLOEXEC through ensure_socket_close_on_exec(), using checked fcntl fallback handling on POSIX platforms such as macOS; close and reject a socket when the invariant cannot be established. Windows retains its non-inheritable SOCKET behavior. Expose cbm_httpd_listener_close_on_exec() and cbm_http_conn_close_on_exec() in src/ui/httpd.h so tests can assert the opaque transport lifecycle contract. Add listener and accepted-connection coverage in tests/test_httpd.c. Validation: CBM_ONLY_SUITE=httpd build/c/test-runner: 44 passed, 1 Windows-only skip under ASan/UBSan. scripts/check-source-safety.sh: passed. Signed-off-by: Andrew Hundt <ATHundt@gmail.com>