• src/sbbs3/mqtt.c

    From Rob Swindell@VERT to Git commit to main/sbbs/master on Thu Dec 29 14:16:20 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/5eb8d99a03ecf04c8ee948a9
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Add TLS support

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Jan 1 20:28:10 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/f2f5e8202a667a592d82cf9b
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Resolve GCC warning: enumeration value ‘SERVER_COUNT’ not handled in switch

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Jan 2 15:13:54 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/1e97f8b666303a4b89d97721
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Resolve GCC warning about function prototype mismatch

    warning: passing argument 2 of ‘mosquitto_message_callback_set’ from incompatible pointer type

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Jan 2 18:41:45 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/c69279b69b7ec59c469ae4ad
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Don't call mosquttio (MQTT lib) functions when disabled

    Should fix the new crash issues reported by Retros via #synchronet on irc.synchro.net

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Jan 2 18:52:44 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/fc89e9418884bbc9e8314b26
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    More support for running (without crashing) with MQTT disabled

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Jan 2 19:26:06 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/480a849a677a082f63523b10
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Fix total-disablement of MQTT support in previous crash-fix-commit

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Wed Jan 4 16:30:22 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/7ef33bc8bdab0350f0fd32f5
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Fix crash in mqtt_errormsg() when MQTT is disabled

    Should fix the segfault reported by NeoArata_ in #synchronet

    Also include singular/plural error/s in server status messages.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Wed Jan 4 19:02:58 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/9c6c3b4cb913ff4591c443e3
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Prepend "server/" before server topics

    This solves the problem of subscribing to "sbbs/+/+/+" and getting node status in addition to server status (very different formatted messages).

    Also include a change for the singular-again "node" topic

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Jan 9 15:52:32 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/eb89e5ad130e37ab55c3cca2
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Log to log/# topic only when MQTT protocol version is < 5

    When MQTT protocol version is >= 5, just log to the */log topic
    (the level is a property).

    This means you can't subscribe only to specific log levels when using MQTT v5 so I may re-think this, but I don't want to keep publishing every single log message twice.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sat Jan 21 13:15:16 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/f3ec8613ad68bbfa38070414
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Refactor mqtt_client_on()

    This function has been causing somewhat rare crashes (e.g. one per week on a very active system with MQTT enabled) on both Windows and Linux (see issue #495). The root-cause is still unclear (possible heap corruption?). This function needed more robustification anyway (see previous TODO comment), so I'm refactoring here to no longer use strListAppendFormat, which uses vasprintf (the function where the rare crash was occurring) and instead just use snprintf and strListPush. The total client_list that's published (as a single string/message) is now dynamically allocated (this was the point of the previous TODO comment). This may not actually fix the issue if there's a heap corruption occurring somewhere else in this function or the call-chain that's reaching here (usually from the web server).

    Another change to mqtt_client_on(): don't incremented the server's 'served' counter until client disconnects (this is a past-tense statistic).

    Also:
    - mqtt_pub_strval() can now accept a null 'str' argument which is effectively the same as mqtt_pub_noval(), so the pub_noval() function is now just a thin wrapper around pub_strval().

    - mqtt_startup() now clears the client_list topic and sets the client_count topic to 0.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Jan 23 19:04:31 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/f77f1984938bd8ec08f670a4
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Fix crash in mqtt_startup() when configured broker isn't reachable

    ---
    þ 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 Sun Jan 29 20:23:59 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/54aec8bf75ff9d8bca6c25f1
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Fix accidental static storage for login/logout functions

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Jan 30 16:00:04 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/ae705bb6896a333130d2c4c2
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Lowercase the protocol name in action/login and logout topics

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Jan 30 17:36:02 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/02a3031aae2584171cde4253
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Convert spaces to underscores in MQTT topics

    e.g. "action/hack/smtp login" -> "smtp_login", best practices and all.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows)@VERT to Git commit to main/sbbs/master on Thu Feb 2 18:09:10 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/56b07155c5a29f173f3071cf
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Don't include number of user's file uploads in action/[upload|download] msgs

    ---
    þ 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 Thu Mar 2 01:11:32 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/c8cd09935276aa80d384fd14
    Modified Files:
    src/sbbs3/mqtt.c
    Log Message:
    Re-publish the server error_count topic in mqtt_startup()

    Fixes a stale non-zero error_count retained topic.

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