diff --git a/ChangeLog.txt b/ChangeLog.txt index f60ec06e42..afc8235cf3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -37,6 +37,8 @@ Client library: connect successfully without verifying certificates, because they were not configured. - Disable TLS v1.3 when using TLS-PSK, because it isn't correctly configured. +- Threaded mode is deconfigured when the mosquitto_loop_start() thread ends, + which allows mosquitto_loop_start() to be called again. Closes #2242. Clients: - mosquitto_sub and mosquitto_rr now open stdout in binary mode on Windows diff --git a/lib/thread_mosq.c b/lib/thread_mosq.c index dbbda85ed6..32a3e7e06f 100644 --- a/lib/thread_mosq.c +++ b/lib/thread_mosq.c @@ -129,6 +129,9 @@ void *mosquitto__thread_main(void *obj) /* Sleep for our keepalive value. publish() etc. will wake us up. */ mosquitto_loop_forever(mosq, mosq->keepalive*1000, 1); } + if(mosq->threaded == mosq_ts_self){ + mosq->threaded = mosq_ts_none; + } return obj; }