• src/sbbs3/mqtt.cpp

    From Deucе@VERT to Git commit to main/sbbs/master on Mon May 11 11:03:03 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/6c26a249234f5457bc25dae1
    Modified Files:
    src/sbbs3/mqtt.cpp
    Log Message:
    mqtt.cpp: guard internal-client-only statics with #ifndef USE_MOSQUITTO

    The lputs adapter, its mutex, and pthread_once init are only used by
    the internal client connect path, not the mosquitto path.

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

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Thu Aug 6 11:27:43 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/b073feab243a6e9136962c24
    Modified Files:
    src/sbbs3/mqtt.cpp
    Log Message:
    mqtt: recognize OS hostname for internal broker

    Internal broker selection preferred startup->host_name whenever it was configured and used gethostname() only as a fallback. When Synchronet's
    global hostname differed from the machine hostname, a broker address
    matching the machine was classified as remote. No process started the
    internal listener, and every server attempted a failing TCP connection
    instead.

    Compare the broker address independently against both the OS hostname
    and the configured service hostname. Also initialize and explicitly
    terminate the gethostname() buffer so a lookup failure or maximum-length
    result cannot affect the comparison. Remote broker addresses continue to
    take the TCP client path.

    Verified by compiling:
    clang.freebsd.amd64.obj.debug-mt/mqtt.o
    and running git diff --check.

    Co-Authored-By: OpenAI Codex <noreply@openai.com>

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT 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>

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