Skip to content

Commit

Permalink
Deconfigure thread mode when the loop thread ends.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ralight committed Aug 24, 2021
1 parent 9526b4c commit 0d1837e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.txt
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib/thread_mosq.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0d1837e

Please sign in to comment.