From b9318b7f9657084f4366afb36412c234faf67b9a Mon Sep 17 00:00:00 2001 From: imhao183 Date: Fri, 12 Mar 2021 14:41:09 +0800 Subject: [PATCH] Merge branch 'meetecho_master' * meetecho_master: (345 commits) Remove support for framemarking RTP extension (#2640) Prevent race conditions on socket close in SIP and NoSIP plugins (#2599) Fixed overflow runtime error Fix for race condition between VideoRoom publisher leaving and subscriber hanging up (fixes #2582) (#2637) Send PLI when starting a paused stream (#2645) Prevent too high shift exponent Fixed type of seq/ts in file-based Streaming mountpoint threads Fix missing g_thread_unref when a streaming helper thread quits. Added custom headers for SIP INFO request (#2644) Free participant->user_id_str in case of opus enc/decoder error. Reject flexfec when offered, as still unsupported (see #2639) Don't add rtx ssrc if m-line is recvonly/inactive (see #2639) Added NULL checks for json_dumps (see #2629) Parse custom headers, if required, in successful REGISTER response (fixes #2636) Timestamp correction for janus-pp-rec (#2573) Don't chain error handler to success handler in Janus.httpAPICall (#2569) Add missing library link for WS event handler (fixes #2628) Fixed broken switch in Streaming plugin when using helper threads Resolves meetecho/janus-gateway#2624 jansson double referencing (#2634) Unlock mountpoints mutex after the spawning of helper threads. ... # Conflicts: # transports/janus_mqtt.c (cherry picked from commit 1827315939ae4f6f7135d15119ce3a1d0ecb06ec) --- transports/janus_mqtt.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/transports/janus_mqtt.c b/transports/janus_mqtt.c index 62d3ee7bae..6788c8b5f6 100644 --- a/transports/janus_mqtt.c +++ b/transports/janus_mqtt.c @@ -135,6 +135,8 @@ static struct janus_json_parameter configure_parameters[] = { #define JANUS_MQTT_ERROR_UNKNOWN_ERROR 499 +static int g_continue_failure_count = 0; + /* MQTT client context */ typedef struct janus_mqtt_context { janus_transport_callbacks *gateway; @@ -928,11 +930,18 @@ int janus_mqtt_send_message(janus_transport_session *transport, void *request_id #endif if(rc != MQTTASYNC_SUCCESS) { + g_continue_failure_count++; JANUS_LOG(LOG_ERR, "Can't publish to MQTT topic: %s, return code: %d\n", admin ? ctx->admin.publish.topic : ctx->publish.topic, rc); + } else { + g_continue_failure_count = 0; } - + if(g_continue_failure_count > 10) { + exit(EXIT_FAILURE); + } + json_decref(message); free(payload); + return 0; }