• src/sbbs3/mqtt.cpp

    From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Tue Oct 27 19:41:34 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/9b406886142427be17d8f2a2
    Modified Files:
    src/sbbs3/mqtt.cpp
    Log Message:
    mqtt: keep the client list current while the broker is unreachable (#1306)

    mqtt_client_on() returned early whenever the broker connection was down, skipping the client list update along with the publish. A client that disconnected during a broker outage was never removed, so it stayed in
    the retained client/list topic and the "client" count indefinitely, and a client that connected during the outage was never listed. This affects libmosquitto builds using an external broker, which reconnect
    automatically after the link drops.

    The client list is now maintained regardless of broker connection state;
    only the publishing is skipped while disconnected. The client count,
    served count, and client list are republished on every broker
    (re)connect, so the retained topics catch up with whatever changed during
    the outage, and stale values left by a previous run are replaced at
    startup.

    The list is now guarded by the existence of a client handle (the list is
    freed in mqtt_close()) rather than by the connection state, and the list
    lock is held through publishing so that a stale snapshot can't be
    published after a newer one.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)