https://gitlab.synchro.net/main/sbbs/-/commit/9a207243c5dba9458d1ed0a3
Modified Files:
src/sbbs3/ctrl/MainFormUnit.cpp
Log Message:
sbbsctrl: don't drop shutdown-summary log lines from disk logs
The four per-server log handlers (bbs/mail/ftp/web_log_msg) gated disk
writes on `XxxLogFile && XxxStop->Enabled`, but the latter half closed
the window too early during a graceful shutdown -- the final
`#### XxxX Server thread terminated (NN clients served, ...)` summary
line was logged to the GUI but never persisted to disk, hiding useful operational data (e.g. rate-limit / IP-filter denial counts) from
post-hoc analysis.
The `Stop->Enabled` half of the gate is original 2000-era code
(7e3e47141, "Initial check-in: v3.00c") and worked in practice for 25+
years by accident: the old `xxx_set_state` switch only handled
SERVER_STOPPED and SERVER_READY explicitly, so transitional states
fell through and left `Stop->Enabled` at its previous (true) value
through the entire shutdown sequence -- only flipping false on the
final SERVER_STOPPED callback that fires *after* the summary line is
emitted. The gate happened to be open at exactly the right moment.
f65fd89a1 ("Resolve crashes during graceful server termination(s)")
moved control updates out of the background-thread state callbacks
onto the 2 Hz LogTimer and rewrote the mapping as a strict flat
assignment:
MainForm->FtpStop->Enabled = (state == SERVER_READY);
That tightened `Stop->Enabled` from "best-effort proxy for
is-server-running" to literally `state == SERVER_READY`. As soon as
shutdown begins, state leaves SERVER_READY, the next LogTimer tick
flips the flag to false, and disk logging stops -- well before the
summary line is emitted. The fix didn't introduce the gate; it just
removed the slack that was masking it.
d0252720e ("sbbsctrl: Add 'Log to Disk' option for Terminal and Web
servers", resolves #1108) then added disk logging to Telnet and Web
and copied the Mail/FTP gate pattern verbatim, so those two arrived
broken.
Drop the `XxxStop->Enabled` half of the gate in all four handlers;
the user's "Log to Disk" preference alone is the right condition.
Resolves #1146
Co-Authored-By: Claude Opus 4.7 (1M context) <
noreply@anthropic.com>
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net