• src/sbbs3/mqtt.c

    From Rob Swindell@VERT to Git commit to main/sbbs/m on Mon Jan 9 15:52:00 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/m on Sat Jan 21 13:15:00 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/m on Mon Jan 23 19:04:00 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 L@VERT to Git commit to main/sbbs/m on Sun Jan 29 20:23:00 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/m on Mon Jan 30 16:00:00 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/m on Mon Jan 30 17:36:00 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/m on Thu Feb 2 18:09:00 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