Deconfigure thread mode when the loop thread ends.

Threaded mode is deconfigured when the mosquitto_loop_start() thread ends,
which allows mosquitto_loop_start() to be called again.

Closes #2242. Thanks to Timo Lange.
This commit is contained in:
Roger A. Light 2021-08-24 11:51:38 +01:00
parent 9526b4cf23
commit 0d1837ebe3
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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;
}