• src/sbbs3/ctrl/MainFormUnit.cpp

    From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Jan 17 20:28:58 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/0ec57ba37667ee38b85738b0
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    load_cfg() now requires the size of the error string buffer passed as argument

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Mar 28 00:52:23 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/efe3b357b3b15c4ab22920e5
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    Remove unused stub function.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Thu Mar 31 00:55:24 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/54c0696a53ba7406be4b93e1
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    Total timeon stats in days/hours/min format instead just massive minutes.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows)@VERT to Git commit to main/sbbs/master on Tue Apr 4 19:45:47 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/2bcb64e177dacd62c9582165
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    Update to new sbbs_write_ini() usage, hard-code backup level to 10 (for now)

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Wed Sep 27 18:53:49 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/5d2195b2353b9f9178a4ebb5
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    Don't read/write or import/export Font "Height" property, redundant with "Size"

    Also:
    For log message styles (e.g. colorization) based on log level, don't apply
    a different font (Name) or size. This just looks terrible when this is done
    and I don't think any sysops want that. Keep each log window using the same font face (name) and size, just allow the color and style (e.g. bold, italics) to change based on log severity.

    This does increase the confusion with the Properties->Customize->Log Fonts
    as the "Change Font" dialog still allows the sysop to select/change a font
    face and size, they're just not saved/used. I coudln't find a way to remove
    or disable these from the displayed TFontDialog form.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Thu Sep 12 22:59:23 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/89637f0d043c012741932076
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    Display horizontal splitter in the correct spot.

    For who knows how long now, the horizontal splitter that allows the sysop
    to control the size of the top 2 panels (server forms), was displayed above
    the top panel, not between the top and bottom panel, thus making the panel heights not controllable. Weird. Change the order of making the controls visible to insure that the splitter is displayed below the top panel and
    on top of the bottom panel.

    Also (non-functional changes):
    Remove redunant mutex from client_on() - makes no difference.
    Use try/catch in client_on() to try to catch VCL exceptions - doesn't catch
    the "invalid index" error popups that we see on occasion. <shrug>

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Sat Sep 21 13:08:41 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/f4a2249b0d0c49dcdbc6ea06
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    Don't update displayed stats values if getstats() returns false (failure)

    Use byte_estimate_to_str() to display upload/download byte totals (better support for totals in gibibytes, tebibytes, etc.).

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Thu Jan 2 00:34:57 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/bf1a2d4c3d34f3fda712bada
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    Remove the -l25 from the default SCFG command-line

    ... since that puts us back into VGA tall-font mode

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Wed Jan 8 18:56:14 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/57d4c080e28191752cb2ed0b
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    Fix the removal of "main.ini" filename from CtrlDir path, if supplied

    Converting the path to UPPER case and then comparing against a lowercase
    string would never work.

    Bug introduced in commit 6edc027042d7, reported by xbit (XBITBBS)

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Sun Dec 7 21:12:24 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/a2cd1d341bc92ee3556a8694
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    Wrap all ClientForm->ListView->Items accesses in try/catch

    ... this appears to resolve the "invalid index" exceptions that could get thrown and pop-up error dialogs in SBBSCTRL-Win32 ... finally.

    It's a mystery how the ListMutex isn't successfully protecting the ListView (the ListView->Items->Count becomes out of sync?), but if the array index
    into the ListView->Item array is invalid, it must be. Pretty weird.

    Also, if WaitForSIngleObject() fails (to acquire the ListView mutex), popup
    an error dialog box. I have not observed any mutex acquisition failures.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Sun Jan 4 08:32:04 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/bf431220dd59fefe1c755d9d
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    Use the configured Statistics Interval

    for the SBBSCTRL:Statistics windows update timer interval

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Sun Jan 4 09:17:45 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/ba97cebf8d280eb28d86bbb6
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    Timer interval is in milliseconds, not seconds (whoops)

    Also, insure a minimum interval (lower bound) of one second here.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Mon Jan 5 05:29:36 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/76d270258fa4bcc644e656a9
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    Use minutes_to_str() for the TimeToday statistics (e.g. "59m", or "5.6h")

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Mon Jan 12 22:51:03 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/f65fd89a106023a5aa7570ce
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    Resolve crashes during graceful server termination(s)

    These crashes have been happening seemingly forever, but only noticed (by me) when running in a debugger, otherwise Windows seems to suppress any exception message/popup since the process terminates anyway.

    The problem appears to be that we were setting app controls (e.g. start/stop button states) in the startup->set_state callbacks and it was possible through race conditions that the application (or at least the forms) were actually destroyed already at the time those callbacks are called (to a report server state of STOPPED as one of the last things each server thread does).

    The solution was to store the value of the reported server states in (global) variables and asynchronously (at "appy time") update the relevant controls based on the server state(s). Since the LogTimer runs more frequently (2Hz) than UpTimer (1Hz) and isn't stopped (early) during process termination,
    that was the place best-suited to do these control updates.

    In this process, I also made the app controls make more sense (e.g. the
    "Start" button is disabled during server initialization) and the "Abort" dialing while waiting for graceful server termination(s) is much improved
    (e.g. lists all the servers still running), but now it does not popup for 60 seconds after termination requested (rather than 30 seconds as before) - as
    if the user presses "Yes", this initiates an *ungraceful* exit of the program which could result in crashes (though Microsoft seems to suppress the user notification of these).

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Fri Feb 6 03:20:31 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/1856c762225ee58c86995ca9
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    Don't update Clients form directly from startup->client_on() callback

    This apppears to finally at long last resolve the "Index out of range" error
    - it's simply not safe to update GUI controls from other threads, so we're doing the update from the LogTimerTick (using a linked-list/queue of changes).

    The log timer ticks at 2Hz (we could increase that), so the Clients list isn't quite as "real time" as before, but it's plenty fast and smooth for my liking.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Wed Mar 11 02:35:20 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/b628ad930c2f4ed85b559c6c
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    Restore Form "View states" - don't display always restore all forms as visible

    We've been saving the various form "Visible" states to the Registry forever, but we never restored those states upon startup. e.g. if you didn't want the "Clients" form to be viewable, for example, too bad, it'd also default to shown /visible on startup. That's now fixed: if you turn off the visibilty of any form (the servers, clients, nodes), they'll still off/invisible when you rerun sbbsctrl.

    Also removed some old C++Builder 5 work-around that was forcing the tabsheet's active page to a potentially blank/empty page.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Wed Apr 22 22:31:11 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/2bceb328e37f8cda3e2affa2
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    When NT Services are in use, the ServiceStatusTimerTick() controls the status

    start/stop button states, status caption

    Fixes toggling between local server status ("Down") and NT service status
    (e.g. "Running NT Service") as reported by Haxor. Not functional impact, just cosmetic.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Sat May 23 21:25:45 2026
    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
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Sat May 23 21:46:34 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/1082de20dca523f276c780ba
    Modified Files:
    src/sbbs3/ctrl/MainFormUnit.cpp
    Log Message:
    sbbsctrl: fflush per-server disk-log streams after each write

    Follow-up to 9a207243c (resolved #1146): with the Stop->Enabled gate
    removed, the shutdown-summary line now reaches the disk-log fwrite() in
    each of the four xxx_log_msg() handlers -- but rob noticed that the
    line still didn't *appear* in the file until sbbsctrl was quit. Cause: _fsopen() returns a fully-buffered stream, and the handlers never flush; written data sits in the CRT buffer until the close sentinel (msg==NULL)
    calls fclose() at sbbsctrl shutdown, or until the next date rollover
    recreates the file.

    Add a plain fflush(LogStream) after each fwrite(). On Windows this is essentially free -- fflush copies the CRT buffer to the OS page cache
    (no FlushFileBuffers, no disk sync), and the OS handles physical
    writeback on its own schedule -- so per-line flushing is fine and
    avoids the "lines stranded indefinitely after the last write of a
    quiet period" failure mode of any timer/threshold-based scheme.

    Same provenance as the previous fix: the missing-fflush has been in
    the Mail/FTP handlers since the initial v3.00c import in 2000
    (7e3e47141), and was propagated to the new Telnet/Web handlers in
    d0252720e (resolves #1108).

    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net