next_msg_out must be protected with the msgtime_mutex
as done everywhere else in the code else there is a data race
e.g. if mosquitto_publish is called from another thread
Signed-off-by: Christian Salvasohn <csalvasohn@gmx.de>
When using the library asynchronously, TLS errors caused e.g. because
of the date/time not set correctly, cause the connection to be silently
dropped without the disconnection callback being invoked, as described
in issue #1052.
This commit fixes the issue, returning the behavior to the one the
library had previous to version 1.5.4, if a TLS error occurs, the
disconnect callback will be invoked for the client to get notified of
the error.
Signed-off-by: doragasu <doragasu@protonmail.com>
Fix reconnecting failing when MOSQ_OPT_TLS_USE_OS_CERTS was in use, but none
of capath, cafile, psk, nor MOSQ_OPT_SSL_CTX were set, and
MOSQ_OPT_SSL_CTX_WITH_DEFAULTS was set to the default value of true.
Closes#2288. Thanks to Poltorak Serguei.
An MQTT v5 client connecting with a large number of user-property properties
could cause excessive CPU usage, leading to a loss of performance and
possible denial of service. This has been fixed.
If a plugin had granted ACL subscription access to a
durable/non-clean-session client, then removed that access, the client would
keep its existing subscription. This has been fixed.
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 would happen with a corrupt/crafted configuration file. Unless your
configuration file is writable by untrusted users this is not a risk.
Closes#567213. Thanks to Roland Sako.
This older Microsoft compiler does not support mixing declarations and
code and misses some error defines. This commit enables building with
VS2008 by moving up some variable declarations and defining error
codes to their WinSock counterparts in case they're not defined.
Signed-off-by: Christian Beier <info@christianbeier.net>
This would occur if a client was using `mosquitto_loop_start()`, then if
the connection failed due to the remote server being inaccessible they
called `mosquitto_loop_stop(, true)` and recreated the mosquitto object.
See: https://www.eclipse.org/forums/index.php?t=rview&goto=1839865#msg_1839865