Commit Graph

120 Commits

Author SHA1 Message Date
Roger A. Light
269756a171 Fix high CPU use on slow TLS connect.
Closes #2794. Thanks to Evgeny S.
2023-04-27 23:25:52 +01:00
Roger A. Light
6f61710fa7 Merge branch 'fixes' of github.com:Daedaluz/mosquitto into Daedaluz-fixes 2023-03-27 23:37:55 +01:00
Tobias Assarsson
2e2a420099 use CLOCK_BOOTTIME when available.
Signed-off-by: Tobias Assarsson <tobias.assarsson@gmail.com>
2023-03-02 09:04:59 +01:00
Roger A. Light
6468bb4f9b Fix documentation omission around mosquitto_reinitialise.
Closes #2489. Thanks to rroguski
2022-08-10 14:31:34 +01:00
Roger A. Light
e979a46c04 Backport SSL connect fixes.
Closes #2594.
Closes #2595.
2022-08-09 21:25:54 +01:00
Roger A. Light
0c9d9f2163 Don't set SIGPIPE to ignore, use MSG_NOSIGNAL instead.
Closes #2564. Thanks to nmeum.
2022-08-07 23:04:46 +01:00
Roger A. Light
a1a190b482 Pointless whitespace tidy. 2021-10-05 15:20:37 +01:00
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.
2021-09-24 16:50:53 +01:00
Roger A. Light
16fb0025a7 Improve QoS 0 outgoing packet queueing. 2021-05-18 16:53:45 +01:00
Roger A. Light
b7a08d5c40 Fix TLS bridge/lib incorrectly connecting on invalid CA file.
Closes #2130. Thanks to becz.
2021-03-11 12:45:04 +00:00
Roger A. Light
a4389fc9ce Fix SPDX identifiers: EDL-1.0 -> BSD-3-Clause.
The two licenses are the same.
2021-01-20 11:46:18 +00:00
Nikolay Raspopov
71845d28ac
Fixed some VS2017 compilation error and warnings (#1916)
* Fixed some VS2017 compilation errors and warnings.

Signed-off-by: raspopov <raspopov@cherubicsoft.com>
2020-12-02 15:59:45 +00:00
Roger A. Light
3731535298 Add SPDX license identifiers. 2020-12-01 20:46:56 +00:00
Roger A. Light
04c110183c Bridge support for MQTT v5 maximum-qos. 2020-12-01 18:15:29 +00:00
Roger A. Light
e030ca45cd Fix connack error printing. 2020-12-01 15:57:37 +00:00
Roger A. Light
a3258f7d82 Packet cleanup without locks
Prevents use of invalid mutexes during mosquitto_destroy.

Closes #1914. Thanks to Nikolay Raspopov.
2020-11-27 15:36:34 +00:00
Roger A. Light
584cf51ba7 Update to EPL-2.0 2020-11-25 17:34:21 +00:00
Roger A. Light
2755fe3c4c Apply limits to QoS 0 outgoing messages. 2020-11-24 12:04:07 +00:00
Roger A. Light
4f61f6c161 Fix conversion errors. 2020-10-17 01:23:08 +01:00
Roger A. Light
6104172bcf Fix connect properties not being sent.
This was happening when the client automatically reconnected.

Closes #1846. Thanks to DSOFreak.
2020-10-14 11:21:41 +01:00
Roger A. Light
2774515456 Fix missing mach/mach_time.h header on OS X.
Closes #1831. Thanks to P-Hagen.
2020-09-22 15:08:48 +01:00
Roger A. Light
acf4ff3738 Fix stdin being closed by mistake
This was closing the sockpair* sockets before they were initialised to INVALID_SOCKET.

Close #1823. Thanks to ostkamp.
2020-09-14 19:35:22 +01:00
Roger A. Light
a53712a14d Don't use logging until log mutex is initialised.
Closes #1819. Thanks to santoshks68.
2020-09-11 17:02:15 +01:00
Roger A. Light
d9003bb858 Don't use mutex until it is initialised.
Coverity Scan 1430456.
2020-07-15 12:12:51 +01:00
Martin Kelly
61a50c60d2 add a refcount to library init/cleanup
Add a refcount around mosquitto_lib_init and mosquitto_lib_cleanup so
that multiple calls to init/cleanup don't trigger memory leaks or
double-frees.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
2020-05-20 10:57:40 +01:00
Roger A. Light
346f695937 Separate out delay code from previous commit.
Plus add missing header.
2020-03-12 13:53:44 +00:00
Roger A. Light
5cf94d2e57 Merge branch 'fixes' of git://github.com/ChristianS99/mosquitto into fixes 2020-03-12 13:52:00 +00:00
Roger A. Light
b0a065f790 Update changelog. Release page. Bump copyright. 2020-02-27 23:26:58 +00:00
Roger A. Light
05ec02b3f3 Remove dead values. 2020-01-23 10:55:49 +00:00
Christian Schneider
a3ebeff9d7 fix: replace sleep with (p)select in loop_forever
sleep was blocking loop_stop(force=false) since it
was uniteruptible

Signed-off-by: Christian Schneider <cschneider@radiodata.biz>
2019-12-18 18:01:50 +01:00
Roger A. Light
494d3d29a0 Fix missing function warnings on NetBSD.
Thanks to Greg Troxel.
2019-08-04 23:00:26 +01:00
Daniel d'Andrada
0970451762 pthread_cancel() is not available on Android
Thus mosquitto_loop_start() and mosquitto_loop_stop()
won't be available there (and mosquitto_connect_async()
as a consequence).

Signed-off-by: Daniel d'Andrada <daniel.dandrada@esrlabs.com>
2019-06-06 15:04:14 +02:00
Roger A. Light
8531cb1d79 Separate broker message queues into in/out.
This allows and includes better flow control handling for QoS>0.
2019-04-17 09:29:34 +01:00
Roger A. Light
baf1909ffb Improve some messages when client disconnects. 2019-04-16 11:40:07 +01:00
John Hickey
c011be62a4 Bridge TLS Application-Layer Protocol Negotiation
In order to connect to brokers that support both websockets and
mqtt on the same port (such as Amazon IoT), we need to set an
application for the SSL context.  This change allows the specification
of an application by using the `bridge_alpn` configuration token.

Signed-off-by: John Hickey <jjh-github@daedalian.us>
2019-04-04 17:27:52 -07:00
Roger A. Light
ea046c2405 Merge branch 'master' of git://github.com/LarsVoelker/mosquitto into LarsVoelker-master 2019-03-26 18:36:13 +00:00
Roger A. Light
320ddc1303 Merge branch 'master'
Conflicts:
	CMakeLists.txt
	ChangeLog.txt
	client/Makefile
	config.mk
	installer/mosquitto.nsi
	installer/mosquitto64.nsi
	lib/mosquitto.h
	lib/mqtt3_protocol.h
	lib/util_mosq.c
	set-version.sh
	snap/snapcraft.yaml
	src/bridge.c
	src/database.c
	src/handle_connack.c
	src/loop.c
	src/persist.c
	test/broker/Makefile
2019-03-16 10:05:38 +00:00
Roger A. Light
ce31269e05 Update changelog, bump version, bump copyright year. 2019-02-28 16:56:15 +00:00
Roger A. Light
f4e24f9524 Use higher resolution timer for random client id generation. 2019-02-26 14:26:05 +00:00
Roger A. Light
8fb4ad48b5 Strings for new error codes. 2019-02-19 15:53:15 +00:00
Roger A. Light
326292681a Add maximum-qos support to broker and client.
This comes in the form of:

* Per listener maximum_qos option, which can be in the range 0-2.
* Changes to mosquitto_publish*() to return MOSQ_ERR_QOS_NOT_SUPPORTED
  if attempting to publish with a higher QoS than supported.
* Bridges will downgrade messages to match the maximum QoS.

More tests on the broker side (specifically bridges) are required. This
needs bridge support for MQTT 5 first.
2019-01-09 18:03:01 +00:00
Roger Light
84660e1cbe Send maximum limits for QoS>0.
This needs more work on the broker front to simplify the design.
2019-01-08 18:38:47 +00:00
Roger Light
67c1d4453e Receive maximum support for clients. 2019-01-08 14:24:41 +00:00
Roger A. Light
fda66e8311 Add broker test for assigned client id. 2018-12-05 20:26:43 +00:00
Roger A. Light
54db895cb3 Rename clean_session to clean_start for v5. 2018-11-27 10:02:10 +00:00
Roger A. Light
f9e0fa246a Validate properties coming into client library. 2018-11-01 18:53:06 +00:00
Roger A. Light
c19b3598c0 Add mosquitto_string_to_command. 2018-10-30 11:40:06 +00:00
Roger A. Light
636e813d1c Load of constant renames ahead of making mqtt_protocol.h public. 2018-10-30 11:11:31 +00:00
Roger A. Light
05b40b90db Add reason strings. 2018-10-04 12:43:43 +01:00
Roger A. Light
574fb36ede More utf-8 validation. 2018-04-13 17:42:16 +01:00