Subj : src/sbbs3/main.cpp To : Git commit to main/sbbs/master From : Rob Swindell (on Debian Linux) Date : Mon Jul 06 2026 00:00:16 https://gitlab.synchro.net/main/sbbs/-/commit/39112546f2b835451e37289b Modified Files: src/sbbs3/main.cpp Log Message: Fix client-socket errors misreported as spy-socket errors on *nix (#1184) input_thread() identified which socket a failed/completed recv() belonged to by re-comparing 'sock' against the atomic sbbs->client_socket after the fact. Since sbbs_t::hangup() (and other cross-thread teardown) closes the client socket and stores INVALID_SOCKET to wake this thread, the identity re-check could fail for a socket that WAS the client socket, misrouting an ordinary disconnect into the *nix else-branch that assumes any non-client socket is the node's local spy socket. Result: routine (usually SSH) session teardowns were logged to error.log as, e.g.: Node 11 !ERROR 9 (Bad file descriptor) on local spy socket 179 receive where fd 179 was actually the node's passthru/client socket, never a spy connection -- sending the sysop hunting for spy-socket problems that don't exist. Observed four times since Jan-2025 on Vertrauen's Linux host, always coinciding with 'disconnecting client' teardown. Remember which socket was selected at poll time (new 'spy_sock' bool) and branch on that instead, at all four re-comparison sites: the SSH receive path, the receive-error handler, the EOF/'disconnected' check, and the skip-telnet-interpretation check. A post-hangup wake-up now routes to the client branch, which exits quietly via the existing !online check (hangup clears 'online' before closing the socket). Validated against a live scratch terminal server: client disconnect, spy connect/mirror/disconnect (clean 'Closing local spy socket' notice), and server-terminated-mid-session teardown -- no misattributed spy-socket errors logged. Closes issue #1184. Co-Authored-By: Claude Fable 5 --- þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net .