Problem
handle_client (pipe) and handle_socket_client (TCP) share ~80% of their logic: snapshot capture, LRU eviction, session management, event polling, pin/unpin, and the large if/else-if dispatch chain. Any bug fix to one must be replicated in the other.
Proposed Solution
Extract a shared function that both handlers call, leaving only the transport-specific read/write in each handler.
References
- Correctness audit item 10
daemon/src/server.cpp:51-257
daemon/src/tcp_server.cpp:90-343
Problem
handle_client(pipe) andhandle_socket_client(TCP) share ~80% of their logic: snapshot capture, LRU eviction, session management, event polling, pin/unpin, and the large if/else-if dispatch chain. Any bug fix to one must be replicated in the other.Proposed Solution
Extract a shared function that both handlers call, leaving only the transport-specific read/write in each handler.
References
daemon/src/server.cpp:51-257daemon/src/tcp_server.cpp:90-343