Commit Graph

95 Commits (a9a5ac2283feeb58a3cb1e78d3bda14bdf475d13)

Author SHA1 Message Date
Tobias Assarsson a9a5ac2283 Don't reuse topic alias after reconnect. 3 years ago
Roger A. Light a1a190b482 Pointless whitespace tidy. 4 years ago
Roger Light 07399c2f3c Fix `mosquitto_pub -l` quitting if broker unavailable.
This could occur when a message publication is attempted when the broker
is temporarily unavailable.

Closes #2187. Thanks to JsBergbau.
4 years ago
Roger Light e1c8f09372 Remove C++ style comments. 4 years ago
Roger Light 2de8c15bc9 Minor build fixes. 5 years ago
Roger A. Light 24920c9a08 Fix possible loss of data in `mosquitto_pub -l` when sending multiple long lines.
Closes #2078. Thanks to Ysincit.
5 years ago
Roger A. Light a4389fc9ce Fix SPDX identifiers: EDL-1.0 -> BSD-3-Clause.
The two licenses are the same.
5 years ago
Roger A. Light 3731535298 Add SPDX license identifiers. 5 years ago
Roger A. Light 29c771cdd4 Add lib and client support for OS CA certs
- Add `MOSQ_OPT_TLS_USE_OS_CERTS` option, to instruct the client to load and  trust OS provided CA certificates for use with TLS connections.
- All clients now load OS provided CA certificates if used with `-L
  mqtts://...`, or if port is set to 8883 and no other CA certificates are
  used. Closes #1824.
- Add the `--tls-use-os-certs` option to all clients.

Closes #1824. Thanks to Jens Reimann.
5 years ago
Roger A. Light 584cf51ba7 Update to EPL-2.0 5 years ago
Dan White a65242d74a mosquitto_pub: exit if broker actively refuses a connection
Fixes eclipse/mosquitto#1904

If the broker rejects the connection, as opposed to the broker being
down, then there is no hope to establish a connection.  This adds a
status flag so we can signal to the loop that we should just exit.

Signed-off-by: Dan White <dan.white@valpo.edu>
5 years ago
Dan White 61702d7acc mosquitto_pub: exit if server becomes unreachable and QOS > 0
Fixes eclipse/mosquitto#1899

In stdin line mode, mosquitto_pub will continue running and accepting
input even if/when/after publishing fails.  This condition is reached
when it first successfully establishes a connection and the server later
is unreachable.

Exiting with a non-zero exit code allows for much easier health
monitoring when used in a long-running pipe.

Signed-off-by: Dan White <dan.white@valpo.edu>
5 years ago
Roger A. Light c90e49af1b Merge remote-tracking branch 'origin/fixes' into develop 5 years ago
Roger A. Light e2123b2561 Add --version for all clients. 5 years ago
Roger A. Light a224a8f217 Don't busy loop with `mosquitto_pub -l` on a slow connection. 5 years ago
Roger A. Light 9929ce0a26 All clients exit with an error exit code on CONNACK failure.
Closes #1778. Thanks to jflambert.
5 years ago
Roger A. Light 5b4b079105 mosquitto_pub: Print reason string on publish error, if it exists. 5 years ago
Roger A. Light 40bad1a999 Fix conversion warnings in client code
Issue #1653.
6 years ago
Roger A. Light d96543c0b8 Merge branch 'fixes' into develop 6 years ago
Roger A. Light b0a065f790 Update changelog. Release page. Bump copyright. 6 years ago
Roger A. Light 3671a6dfdb Add `-x` argument to all clients.
This allows the session-expiry-interval property to be easily set for
MQTT v5 clients.
6 years ago
Roger A. Light d60e86d2a3 Add TCP_NODELAY support to lib and clients.
Closes #1526. Thanks to Felix Moessbauer.
6 years ago
Roger A. Light c0443637e8 Merge branch 'master'
Conflicts:
	ChangeLog.txt
	config.mk
	src/context.c
	src/loop.c
	src/subs.c
	test/broker/01-connect-bad-packet.py
	test/broker/02-subpub-qos1-bad-pubcomp.py
	test/broker/02-subpub-qos1-bad-pubrec.py
	test/broker/02-subpub-qos2-bad-puback-1.py
	test/broker/02-subpub-qos2-bad-puback-2.py
	test/broker/02-subpub-qos2-bad-pubcomp.py
	test/broker/02-subpub-qos2.py
	test/broker/07-will-null-topic.py
6 years ago
Roger A. Light 1e04b22833 Fix `mosquitto_pub -l` not sending the final line of stdin
This would happen if the final line did not end with a new line.

Closes #1473. Thanks to majekw.
6 years ago
Roger A. Light 22eb193309 Merge branch 'stdin-fix-1' of git://github.com/majekw/mosquitto into majekw-stdin-fix-1 6 years ago
Roger A. Light aabf850a62 Separate pub client loops for better readability. 6 years ago
Roger A. Light 74e1f77310 Fix for previous commit
Stdin mode wouldn't work with normal compiler optimisation levels.
6 years ago
majekw 50c9a4b0b0 Fix `mosquitto_pub -l` hang when stdin stream ends. Closes #1448.
Signed-off-by: Marek Wodzinski <majek@w7i.pl>
6 years ago
Roger A. Light 499e2f2e98 Add support for unix sockets to broker, lib, and clients. 6 years ago
Marek Wodzinski ede9f2a51d mosquitto_pub: split main loop.
Main loop has two different logics inside: one for stdin input,
second for all other cases. Exit loop condition is also different
for both variants. This commit splits these two variants into
two separate loops.

Signed-off-by: Marek Wodzinski <majek@w7i.pl>
6 years ago
Roger A. Light a22ccbd884 Clients: improve error msgs when connecting v3.x broker with v5 client
Closes #1344. Thanks to HowJMay.
6 years ago
Roger Light 1079a1b697
Merge pull request #1342 from HowJMay/remove_redundant_reset
Remove redundant initialization in clients
6 years ago
Roger A. Light b807daed28 Fix error codes not being returned when mosquitto_pub exits.
Closes #1354. Thanks to Ben Barbour.
6 years ago
YangHau 9bb9b6e721 Remove redundant initialization in clients
the `memset(&cfg, 0, sizeof(struct mosq_config));` already exsits in
`client_config_load()`'s `init_config()` function call.
So calling it in main function is totally unnecessary.

Signed-off-by: YangHau <vulxj0j8j8@gmail.com>
6 years ago
Roger A. Light 7d954fa52e Fix `mosquitto_pub -l` not handling network failures.
Closes #1152. Thanks to Dustin Sallings.
6 years ago
Roger A. Light 1bafe0ee2e Fix double free on exit in mosquitto_pub.
Closes #1280. Thanks to Lucky Saini.
6 years ago
Roger A. Light b4dfeb3767 Fix MQTT v5 clients not being able to specify a password without a username.
Thanks to Erik Moqvist.

Closes #1274.
6 years ago
Roger A. Light 999c478c88 Fixes for bug #1273
* Fix Will message for a persistent client incorrectly being sent when the client reconnects after a clean disconnect.
* Fix Will message for a persistent client not being sent on disconnect.
* Fix mosquitto_pub not using the `-c` option.

Thanks to Yannic Schröder.

Closes #1273.
6 years ago
Roger A. Light 29cf965b4f Fix mosquitto_pub exiting with error code 0 when an error occurred.
Thanks to janniswarnat.

Closes #1285.
6 years ago
Roger A. Light 7a33a129d6 Stop some error messages being printed even when `--quiet` was used.
Thanks to Rob de Jonge.

Closes #1284.
6 years ago
Roger A. Light 4dcd977932 Windows build fixes. 7 years ago
Roger A. Light 4995436b5a Add --repeat and --repeat-delay to mosquitto_pub. 7 years ago
Roger A. Light dec769ce33 Client and doc ALPN additions
Add ALPN support for all clients, update documentation, and add to ChangeLog.
7 years ago
Roger A. Light 925debb8a5 Add mosquitto_rr, the "request-response" client. 7 years ago
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
7 years ago
Roger A. Light 2dd24449ad Fix "unused parameter" warnings. 7 years ago
Roger A. Light ce31269e05 Update changelog, bump version, bump copyright year. 7 years ago
Roger A. Light 1924afe49e Add explicit support for TLS v1.3 and drop TLS v1.0. 7 years ago
Roger A. Light 5aabc171b0 Merge branch 'mqtt5' into develop 7 years ago
Roger A. Light e862a047a8 Rework TLS engine support. 7 years ago