Commit Graph

905 Commits (4a7da066e0c81a2daacb5fbe99805151d95a3b26)

Author SHA1 Message Date
Roger A. Light 6468bb4f9b Fix documentation omission around mosquitto_reinitialise.
Closes #2489. Thanks to rroguski
3 years ago
Roger A. Light e979a46c04 Backport SSL connect fixes.
Closes #2594.
Closes #2595.
3 years ago
Kai Buschulte ddd16d54be Make required includes public for libmosquitto
for simplified usage of the CMake target

Issue number: #2452

Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
3 years ago
Kai Buschulte 8b67883548 Remove old compatibility header support
Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
3 years ago
Roger A. Light a913de2d28 Fix some PUBLISH messages not being counted in $SYS stats.
Closes #2448. Thanks to Antoine.
3 years ago
Roger A. Light 0c9d9f2163 Don't set SIGPIPE to ignore, use MSG_NOSIGNAL instead.
Closes #2564. Thanks to nmeum.
3 years ago
Roger A. Light 4cfbb716be Remove unused member 3 years ago
Roger Light ac98c2135f
Merge pull request #2529 from NorbertHeusser/develop
Create github actions to trigger build and tests on devevlop branch
3 years ago
Roger A. Light ca61baf5e3 Merge branch 'add-common-options-target-to-enable-compiler-warnings' of https://github.com/buschulte/mosquitto into buschulte-add-common-options-target-to-enable-compiler-warnings 3 years ago
Roger A. Light 11b16756cb Windows fixes. 3 years ago
Roger A. Light 25bc6f3cf4 Require topics>0 in mosquitto_[un]subscribe*(). 3 years ago
Norbert Heusser f424667fca Merge branch 'develop' into NorbertHeusser:develop 3 years ago
Kai Buschulte 71456077ad Introduce a common-options cmake target
this makes it possible to explicitly share compile options, without
using the `add_definition` function. This function declares options for
the current directory and below (in our case also for `deps`).

Adding -Wall, -Wconversion and -Wextra to at least make compiler
warnings visible for the cmake build.

Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
3 years ago
Kai Buschulte 36935a3384 Use OpenSSL:SSL cmake target
Instead of using the CMAKE_OPENSSL_INCLUDE and CMAKE_OPENSSL_LIBRARY
variables the imported target OpenSSL::SSL is used.
This is a more modern way of target linking.

Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
3 years ago
Roger A. Light 436635fda8 Use absolute rather than relative paths when installing. 3 years ago
Roger Light 38295aeca3
Merge pull request #2559 from newAM/fix-mosquittopp-path
Fix install path to mosquittopp.h
3 years ago
Roger A. Light 546df9db85 Build fixes, particularly pedantic compiler warnings. 3 years ago
Alex Martens bb33c503b6 Fix install path to mosquittopp.h
Signed-off-by: Alex Martens <eclipse@thinglab.org>
3 years ago
Roger A. Light 29f49bf6ab Publish global out_packet values to $SYS 3 years ago
Roger A. Light 2e061afcc6 Fix build 3 years ago
Roger A. Light 4099f8d1b6 Store out_packet bytes rather than having to calculate it. 3 years ago
Roger A. Light ebfebf8708 Fix bridges not sending failure notification messages.
This is for messages to the local broker if the remote bridge connection
fails.

Closes #1488.
Closes #2467.
3 years ago
Roger A. Light b6b8039914 Fix use of `MOSQ_OPT_TLS_ENGINE` being unable to be used.
This was due to the openssl ctx not being initialised until starting to connect.

Closes #2537. Thanks to chessing-c4.
3 years ago
Norbert Heusser 6fbf6fc5cb
Merge branch 'eclipse:develop' into develop 3 years ago
Kai Buschulte 7e4746aac4 Fix missing symbols MacOS
Core symbols needed by plugins are now properly linked to their objects

 * Remove link_directories() call:

This specification is not necessary for our own libraries as cmake
shares this information over the targets.

If needed they should be specified target specific, like done for
the external DLT library.

Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
3 years ago
Norbert Heusser 6150ae6560 Remove mosquitto__set_state after error from send__connect in mosquitto__reconnect to
fix failing test test/lib/02-subscribe-qos1.py $@/02-subscribe-qos1-async2.test

Signed-off-by: Norbert Heusser <norbert.heusser@cedalo.com>
3 years ago
Roger A. Light 4f294a715b Fix WS reads when fragmented packets are sent. 3 years ago
Roger A. Light 75be1ed643 Improve uint16/32 packet read/write performance. 4 years ago
Roger A. Light efc8d064de Bring mosquittopp more up to date with libmosquitto. 4 years ago
Roger A. Light 5fcb2bc13f Simplify use of headers. 4 years ago
Roger A. Light 4c72542eae Move mosquittopp header to include dir. 4 years ago
Christian Salvasohn 4077987593 fix data race mosquitto_loop function
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>
4 years ago
Roger A. Light c53a53bce0 Re-enable LTO for gcc builds. 4 years ago
Roger A. Light 9f9813aff4 Fix Coverity Scan 1486949 Resource leak 4 years ago
Roger A. Light 15cd25c3e9 Fix Coverity Scan 1486949 Resource leak 4 years ago
Roger A. Light a4635682d1 Fix Coverity Scan 1486945 String not null terminated 4 years ago
Roger A. Light cac537830e Fix Coverity Scan 1486949 Resource leak 4 years ago
Roger A. Light 0549a6a9aa Fix Coverity Scan 1486957 Resource leak 4 years ago
Roger A. Light 1d805316ba Fix Coverity Scan 1486949 Resource leak 4 years ago
Roger A. Light fa0b532e69 Fix Coverity Scan 1486948 Structurally dead code 4 years ago
Roger A. Light a94eb99c97 Fix Coverity Scan 1486945 String not null terminated 4 years ago
Roger A. Light 1771dd9941 Fix Coverity Scan 1436854 Resource leak 4 years ago
Roger A. Light c985736866 Restrict persistence events to persisted clients only. 4 years ago
Roger A. Light 39f3030643 Fix client_generated flag not being copied on properties.
Closes #2401. Thanks to Diorcet Yann.
4 years ago
Roger A. Light 96931643a4 Use strings.h for strcasecmp, except on Windows.
Closes #2420. Thanks to Frédéric Fauberteau.
4 years ago
Roger A. Light 2afe19466a Remove unused macro. 4 years ago
Roger A. Light a0f58f20c3 Update threaded builds.
Most specifically use -pthread instead of -lpthread.
4 years ago
Roger A. Light ffb7661d86 Move shared code to common directory
This is currently limited to "utility" type functions and does not include code common to the library and broker that are protocol related.
4 years ago
Roger A. Light 5a3b42d4a4 Use path vars in Makefiles. 4 years ago
Roger A. Light bc1adfd46d CMake fixes.
Builtin websockets support.
Persist sqlite plugin build.
Broker cJSON support
Add wildcard-temp plugin.
4 years ago
Roger A. Light 6b32cf61b2 CMake build fixes, including sqlite support. 4 years ago
Roger A. Light 306215db39 Split library actions.c for easier discoverability. 4 years ago
Roger A. Light b5c77f264f Build fixes 4 years ago
Roger A. Light 4e731d2ac7 Fix lws based websockets connections. 4 years ago
Roger A. Light 75fa83976c Fix `seconds` part of mosquitto_time_ns() on Windows. 4 years ago
Roger A. Light 73f03983fb Socks proxy test plus fixes. 4 years ago
Roger A. Light fa9c2d0285 Fix incorrect header position. 4 years ago
Roger A. Light aa96c2d922 Check accept key with websockets clients. 4 years ago
Roger A. Light f5625f499f Client HTTP request size configurable. 4 years ago
Roger A. Light 0a0f4ead42 Plugin interface interface and test improvements. 4 years ago
Roger A. Light d546ba461a Test fixes. 4 years ago
Roger A. Light 500542351d Set pointers to NULL after freeing. 4 years ago
Roger A. Light 0f8733627a Plugin persistence interface. 4 years ago
Roger A. Light 2501a64035 Merge branch 'master' into develop 4 years ago
Roger A. Light eafa848180 Add client message stats to xtreport. 4 years ago
Roger A. Light affe6ece83 Add client msg int to allow easier ordering for plugins. 4 years ago
Roger A. Light 3b8a2e827e Fix compile flags. 4 years ago
Roger A. Light 94fcd470d0 Fix incorrect subscribe_callback in mosquittopp.h.
Closes #2367. Thanks to Jens Alfke.
4 years ago
Roger A. Light 11975332d4 Fix mosquitto_topic_matches_sub2() not using the length parameters.
Closes #2364. Thanks to Jens Alfke.
4 years ago
Roger A. Light f3590f3020 Don't pass NULL to printf %s.
This is undefined behaviour, and some platforms don't like it.

Issue #2355. Thanks to CJ Lee.
4 years ago
Roger Light 68504da4a6
Merge pull request #2372 from podsvirov/install-libmosquitto-archive
Set ARCHIVE DESTINATION for mosquitto library
4 years ago
Roger A. Light 65d20271a7 Better string 4 years ago
Konstantin Podsvirov b34817cfab Set ARCHIVE DESTINATION for mosquitto library
Signed-off-by: Konstantin Podsvirov <konstantin@podsvirov.pro>
4 years ago
Konstantin Podsvirov 6187143384 Set ARCHIVE DESTINATION for mosquittopp library
Signed-off-by: Konstantin Podsvirov <konstantin@podsvirov.pro>
4 years ago
Roger Light cd07f1136b Bump copyrights. 4 years ago
Roger A. Light 8ac11929cc Merge branch 'master' into develop 4 years ago
Roger Light 92f3db92d7 Windows build fixes. 4 years ago
Roger A. Light 7b614b3b59 Move to end of file on append, when on Windows. 4 years ago
Roger A. Light 91e8344a3e Windows build fixes. 4 years ago
Roger Light 51eda2bf79 Add more efficient keepalive check. 4 years ago
Roger A. Light 21ded3df0d Build fix 4 years ago
Roger A. Light 799cdead15 Experimental custom websockets support. 4 years ago
Roger A. Light be80a3f4d0 Fix client id not showing in log on failed connections, where possible. 4 years ago
Roger A. Light a1a190b482 Pointless whitespace tidy. 4 years ago
Roger A. Light 0ce167c472 Fix log file being truncated on Windows. 4 years ago
Roger Light 3f62e80300
Merge pull request #2317 from doragasu/fixes_discon_cb_on_tls_err
Call disconnect callback on TLS error.
4 years ago
Roger A. Light 0f2f77c945 Improve idle / mux timeout performance. 4 years ago
Roger Light 88dfac8e88 Windows threading support for the library. 4 years ago
Roger A. Light 9e28eea0a2 Initialise sockpairR/W to invalid in `mosquitto_reinitialise()`
This avoids closing invalid sockets in `mosquitto_destroy()` on error.

Closes #2326. Thanks to Arrigo Zanette.
4 years ago
Roger A. Light 330bf6efdc Various fixes around inflight quota management.
Closes #2306. Thanks to canique.
4 years ago
doragasu 4471ee9e47 Call disconnect callback on TLS error.
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>
4 years ago
Roger A. Light aa29b45e70 Merge branch 'master' into develop 4 years ago
Roger A. Light d09591d92e Fix reconnecting in some cases when using MOSQ_OPT_TLS_USE_OS_CERTS.
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.
4 years ago
Roger A. Light 605131502b Fix MOSQ_OPT_SSL_CTX not being able to be set to NULL.
Closes #2289. Thanks to Poltorak Serguei.
4 years ago
Roger A. Light 9d6a73f9f7 Fix CONNECT performance with many user-properties.
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.
4 years ago
Roger Light 32af599c81 Fix $share subscriptions not being recovered for durable clients.
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.
4 years ago
Roger A. Light 376226c129 Build warning fixes. 4 years ago
Roger A. Light 9b25dd3b0d libressl build fixes.
Closes #2198. Thanks to Theo Buehler.
4 years ago
Roger A. Light 0d1837ebe3 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.
4 years ago
Roger A. Light 9526b4cf23 Check for file==dir only when reading. 4 years ago