• src/sbbs3/mqtt.c

    From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Wed Dec 13 19:11:22 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/6abee6374eb0967feb398643
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Fix crash after failing to connect to MQTT broker

    We need to call mqtt_shutdown() instead of mqtt_close() to have the mosquitto (loop) thread stopped.

    Upon connect failure, call the mqtt_shutdown() *before* calling lprintf->lputs, which would eventually try to MQTT-publish the log message.

    The call to mqtt_connect() can block for a while, so raise the log severity
    of the "connecting to broker" message from DEBUG to INFO. Otherwise, a bad
    MQTT broker address or port would make the servers just appear to hang during initialization, for no reason.

    ---
    ■ 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 Dec 13 20:02:50 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/1bc971266525652be3def0a6
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Change the MQTT broker-connect ... successful log message to DEBUG-level

    Since we're logging at INFO level when the connect is attempted, we can assume success when we start logging additional init messages.

    ---
    ■ 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 4 16:05:17 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/f8f85f1e4ae337d9fbbc0caa
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Fix CID 493283: Incorrect expression (NO_EFFECT)
    Comparing an array to null is not useful: "client->protocol == NULL",
    since the test will always evaluate as true.

    or will always evaluate as *false* (the array won't ever be NULL). <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 Thu Jul 11 19:17:01 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/6d01d683c9a87a909bfae902
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Clear (set to 0) each server's "highwater" topic upon startup

    The other server stats (e.g. error_count, served) are zeroed upon startup, so the highwater mark should be zeroed too.

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