https://gitlab.synchro.net/main/sbbs/-/commit/ff1aae498b3464b1f2fd050a
Modified Files:
src/sbbs3/main.cpp
Log Message:
sbbs3 terminal server: drop unsent goodbye output before close_socket
In the four listener exit paths that queue output via the listener
pseudo-sbbs (CLIENT BLOCKED for ip.can / host.can, "no nodes
available", node init failure), call sbbs->rioctl(IOFB) right after flush_output() and before close_socket(). Without this, any
text/badip.msg / badhost.msg / nonodes.txt residue that didn't make
it out within the flush timeout sits in the ring buffer; when the
output thread next wakes it tries to send the leftover on the
now-closed FD, and the failed send logs a noisy warning (e.g.
"!ERROR 22 (...)" or "!ERROR 58 (...)" sending on socket).
This is the same idiom as the existing rioctl(IOFB) at the start of
the per-connection setup (main.cpp:5795) — purge stale buffer state
before changing socket lifecycle.
It does not eliminate the race entirely: data already pulled from
the ring buffer into the output thread's linear buffer is still sent
(or attempted), since rioctl operates on the ring buffer only. The
remaining noise is handled separately by demoting the typical
post-shutdown send errors (ESHUTDOWN, EINVAL) to LOG_NOTICE.
Co-Authored-By: Claude Opus 4.7 (1M context) <
noreply@anthropic.com>
--- SBBSecho 3.37-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)