Commit Graph

220 Commits

Author SHA1 Message Date
Roger A. Light
7c3666d593 Subscription identifier support. 2018-12-20 15:32:43 +00:00
Roger A. Light
fcf4cd0b27 Merge branch 'master' into mqtt5 2018-12-19 14:11:11 +00:00
Roger A. Light
db7901884f Retain-as-published support. 2018-12-14 13:36:02 +00:00
Roger A. Light
a00dd29af8 Fix building where TLS-PSK is not available.
Closes #68.
2018-12-11 10:55:31 +00:00
Roger A. Light
5073d83bf8 Don't generate client ids in v5 mode. 2018-12-05 21:26:22 +00:00
Roger A. Light
34293d07c1 Always print leading zeros in mosquitto_sub when output format is hex.
Closes #1066.

Thanks to skiizo.

Bug: https://github.com/eclipse/mosquitto/issues/1066
2018-12-04 09:24:04 +00:00
Roger A. Light
0123ff1efe Rename *_with_properties() -> *_v5(). 2018-11-22 18:55:04 +00:00
Roger Light
a9d19d0911 Use MQTT 5 reason strings where appropriate in clients. 2018-11-22 18:22:31 +00:00
Roger Light
36e8659762 Only keep reading from stdin if we are connected. 2018-11-22 18:14:12 +00:00
Roger Light
47129e395e Use v5 callback in pub client. 2018-11-22 17:34:42 +00:00
Roger Light
3cb8a52ef3 Add reason code to mosquitto_disconnect_with_properties() 2018-11-22 16:56:17 +00:00
Roger A. Light
85d9cfa2fa Fix pub client stdin mode. 2018-11-22 14:43:35 +00:00
Roger A. Light
dd158ffeb3 Split common publish code into separate file. 2018-11-22 09:02:27 +00:00
Roger A. Light
098a1c8ecf Fix subscribe_multiple datatypes. 2018-11-13 14:05:03 +00:00
Roger A. Light
beb96c6b8b Merge branch 'master' into develop 2018-11-11 21:41:44 +00:00
Roger A. Light
ba67e1ffe5 Don't use gnu-specific strerror_r. 2018-11-07 18:27:15 +00:00
Bartosz Taczała
e86b27a2da Adding support for QNX7.0.0
Change-Id: Id01e2880aa5cadc0e93a46b95fe675e1938051fa
Signed-off-by: Bartosz Taczała <bartosz.taczala@mobica.com>
2018-11-06 23:11:09 +00:00
Roger A. Light
f9e0fa246a Validate properties coming into client library. 2018-11-01 18:53:06 +00:00
Roger A. Light
4c0c632dfa Client memory "leak" fixes. 2018-11-01 16:02:20 +00:00
Roger A. Light
8aa936936e Library and client support for topic-alias. 2018-11-01 15:47:21 +00:00
Roger A. Light
55b46037da Change -y to -D in clients. 2018-11-01 14:22:00 +00:00
Roger A. Light
de3a9af1f7 Client+library support for unsubscribe properties. 2018-11-01 14:12:52 +00:00
Roger A. Light
49a8642986 Disallow properties that are invalid for a command. 2018-11-01 11:59:59 +00:00
Roger A. Light
741a8a9cc3 Client disconnect property support, plus disconnect packet fix. 2018-11-01 11:57:47 +00:00
Roger A. Light
383608613a Client+lib will property support. 2018-11-01 11:37:57 +00:00
Roger A. Light
12cba75c73 Client support for adding properties. 2018-10-31 12:38:39 +00:00
majekw
7f1419e4de Fix mosquitto_pub -l if compiled using cmake.
Since dde005ef92 mosquito_pub is throwing error
that 'threading support has not been compiled' when compiled using cmake.
It looks like WITH_THREADING flag is not set at top level Makefile and used
only in lib/ directory, so library is correctly compiled with threading.
But for client this flag is undefined, so it gives error on '-l' option.

This commit moves part related to WITH_THREADING flag out of lib/CMakeLists.txt
to top levele CMakeLists.txt, so it could be accessible to all subdirectories.

Signed-off-by: Marek Wodzinski <majek@w7i.pl>
2018-10-23 18:56:00 +01:00
Roger A. Light
35dea07dcd Merge branch 'master' 2018-10-23 10:39:20 +01:00
Roger A. Light
e5eb03b2e6 Allow building without shared library. 2018-10-07 00:56:42 +01:00
Roger A. Light
abb3fee1f8 Coverage reporting for whole broker. 2018-10-06 21:56:48 +01:00
Roger A. Light
366744bad7 Fix subscribe_multiple datatypes. 2018-10-04 09:46:51 +01:00
Roger Light
6c9e8d51c2 Merge branch 'develop' into mqtt5 2018-10-02 11:28:03 +01:00
Roger A. Light
1867f30785 Merge branch 'master'
Conflicts:
	ChangeLog.txt
2018-10-02 08:31:54 +01:00
Roger A. Light
0e76bed50e Add -E option to mosquitto_sub.
This causes the client to exit immediately after its subscriptions are
acknowledged by the broker, and can be used to create a durable client
session without requiring messages to be delivered.

Closes #952.
2018-09-27 22:21:42 +01:00
Roger A. Light
33a523eea9 Add identifiers for v5.
Clients know about v5, just need library support...
2018-09-19 10:59:41 +01:00
Roger A. Light
88765a5e80 Consistent use of config.h across the project. 2018-08-16 11:14:51 +01:00
Roger A. Light
dde005ef92 Return error in mosquitto_pub -l if compiled without threading. 2018-08-16 11:06:58 +01:00
Roger A. Light
e240a692a7 Fix compiling on Mac OS X <10.12 due to clock_gettime()
Closes #813 and #240.

Signed-off-by: Roger A. Light <roger@atchoo.org>
2018-08-15 14:54:07 +01:00
Roger A. Light
3d3b7fc46f Fix default port problem when compiling clients using WITH_TLS=no. 2018-08-15 14:34:56 +01:00
Roger A. Light
3c517e617c Fix static mosquitto_sub compiling. 2018-05-01 21:34:28 +01:00
Roger A. Light
9852f94ee0 Merge branch 'sub_client_timeout_upstream' of git://github.com/I2SE/mosquitto into I2SE-sub_client_timeout_upstream 2018-04-12 00:20:02 +01:00
Tifaifai Maupiti
4fc90248c5 Fix _POSIX_C_SOURCE : 199309L to 200809L
Signed-off-by: Tifaifai Maupiti <tifaifai.maupiti@gmail.com>
2018-04-11 23:37:15 +01:00
Roger A. Light
f4d238be18 Bump copyright years. 2018-04-11 15:24:29 +01:00
Roger A. Light
86ced4d98f Add mosquitto_connect_with_flags_callback_set().
This allows a second connect callback to be used that exposes the
MQTT connect flags parameter.

Closes #738, #128.
2018-04-11 14:06:16 +01:00
Roger A. Light
40e6a75709 Use c99 as compiling standard.
Closes: #765.
2018-04-06 00:33:22 +01:00
Roger A. Light
8a22b918c0 Fix Coverity Scan defects. 2018-03-26 22:47:46 +01:00
Roger A. Light
d55da837aa Add %X for upper case hex printing. 2018-03-15 11:27:17 +00:00
Roger A. Light
17029c1e11 Minor usage string updates. 2018-03-15 11:25:18 +00:00
Roger A. Light
5cdfe3239c Separate sub client output code into its own file. 2018-03-15 11:21:42 +00:00
Roger A. Light
611ad222bb Don't keep trying to connect in sub client if CONNACK negative. 2018-03-15 11:13:17 +00:00
Roger A. Light
81cb7ab547 Merge branch 'fixes' into develop 2018-02-13 14:16:47 +00:00
Roger A. Light
15486f48e7 [636] Correctly handle empty files with "mosquitto_pub -l".
Thanks to Aleksandr Makarov.

Bug: https://github.com/eclipse/mosquitto/issues/676
2018-01-22 17:52:56 +00:00
Michael Heimpold
338322fa9c sub_client: allow to specify a timeout (refs #275)
This add a new command line parameter to give a timeout for message
processing. It is implemented using alarm(2) and thus available at
the moment only for POSIX platforms (also because I have no WIN32
build environment at hand).

Signed-off-by: Michael Heimpold <michael.heimpold@i2se.com>
2018-01-12 14:59:53 +01:00
Roger A. Light
9c6a5f3cf0 [656] Fix building on Windows.
Thanks to Arun Kirthi Cherian.

Bug: https://github.com/eclipse/mosquitto/issues/656
2018-01-06 22:42:40 +00:00
Michael Heimpold
48dec391f7 Quote ${DESTDIR} usage in various Makefiles
This prevents failures during make install when whitespace
is part of DESTDIR pathname.

Signed-off-by: Michael Heimpold <michael.heimpold@i2se.com>
2017-12-01 22:28:26 +00:00
Roger A. Light
712cbfe599 Default to mqtt v3.1.1 for clients. 2017-08-09 23:59:08 +01:00
Roger A. Light
59f11aa094 Improve static client building. 2017-07-17 20:47:57 +01:00
Roger A. Light
ef7a7850ac Add -c to mosquitto_pub. 2017-07-17 20:43:06 +01:00
Roger A. Light
e74203de2c Merge branch 'master' into develop 2017-07-16 22:52:01 +01:00
Roger A. Light
6d63468a28 Don't use / in auto-generated client ids. 2017-05-31 21:45:53 +01:00
Roger A. Light
91b308a11d Merge branch 'master' into develop 2017-03-06 21:19:53 +00:00
Roger A. Light
9a2987c145 Missing malloc check. 2017-02-20 23:48:30 +00:00
Roger A. Light
cac5464f7f Use of --ciphers no longer requires you to also pass --tls-version.
Closes #380.

Bug: https://github.com/eclipse/mosquitto/issues/380
2017-02-20 23:48:30 +00:00
Roger A. Light
840453c14f Remove -x from mosquitto_sub - this is provided by -F now. 2016-08-10 12:24:43 +01:00
Roger A. Light
8140ce1f24 Add -F to mosquitto_sub to allow users to choose the output format. 2016-08-10 12:24:43 +01:00
Roger A. Light
8378fe44cf Update copyrights. 2016-07-08 09:42:24 +01:00
Roger A. Light
1c3988a397 Merge branch 'master' into develop 2016-06-21 23:33:58 +01:00
Roger A. Light
a8a5daf06b Check client topic inputs for valid UTF-8. 2016-06-20 22:56:01 +01:00
Roger A. Light
d90cd585dd Add WITH_STRIP build option. 2016-06-13 21:36:41 +01:00
Roger A. Light
99ea5cab7c Default to using port 8883 when using TLS. 2016-05-16 21:56:15 +01:00
Roger A. Light
37dceb38f9 Fix some defects discovered by coverity. 2016-03-18 11:54:36 +00:00
Roger A. Light
49936c8ec3 Incorrect quoting. 2016-03-13 21:18:46 +00:00
Roger A. Light
69a08ab905 Fix string quoting in CMakeLists.txt. Closes #4. 2016-03-13 20:33:08 +00:00
Roger A. Light
35c4d3d59a Handle some unchecked malloc() calls. Closes #1.
Thanks to Markus Elfring.
2016-03-13 19:07:28 +00:00
Roger A. Light
556c629ab5 Don't use reserved names in header guards.
Closes #3.
2016-03-13 18:43:13 +00:00
Roger A. Light
bd61d18e92 Small tidy up. 2016-03-12 21:43:29 +00:00
Matteo Croce
59c80d9197 Add MQTT URL scheme support
Add option -L to specify user, password, hostname, port and topic at once.
The URL must provided with the -L or --url in the form:
mqtt(s)://[username[:password]@]host[:port]/topic

Change-Id: Ia626a28981a38807a254ae32c6ffb29b122b8a28
Signed-off-by: Matteo Croce <matteo@openwrt.org>
2016-03-12 21:43:29 +00:00
Roger A. Light
7f9db87f30 Makefile target for static compiled pub/sub clients. 2016-03-12 20:22:36 +00:00
Roger A. Light
1961404ec9 Add --retained-only to mosquitto_sub. 2016-02-02 20:57:37 +00:00
Roger A. Light
fca9ac84f7 Merge fixes into develop. 2016-01-06 21:10:34 +00:00
Roger A. Light
3aa698d023 Add -U to mosquitto_sub for unsubscribing from topics. 2015-12-29 20:15:00 +00:00
Roger A. Light
c5a376489e [483979] Fix "mosquitto_pub -l" stripping the final character on a line.
Thanks to Allan Kobelansky.

Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=483979
2015-12-18 22:29:32 +00:00
Roger A. Light
89763a51d9 [478917] Don't truncate lines with "mosquitto_pub -l"
Thanks to Jan-Piet Mens.

Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=478917
2015-10-11 22:55:54 +01:00
Roger A. Light
9a2eb2038f Drop Windows XP support, misc fixes on Windows. 2015-09-22 10:03:57 +01:00
Roger Light
e2324ff9bb Merge remote-tracking branch 'remotes/origin/master' into develop
Conflicts:
	CMakeLists.txt
	ChangeLog.txt
	THANKS.txt
	appveyor.yml
	config.mk
	installer/mosquitto-cygwin.nsi
	installer/mosquitto.nsi
	lib/messages_mosq.c
	lib/messages_mosq.h
	lib/mosquitto.c
	lib/mosquitto.h
	lib/net_mosq.c
	lib/net_mosq.h
	lib/send_client_mosq.c
	lib/send_mosq.c
	lib/socks_mosq.c
	lib/will_mosq.c
	src/bridge.c
	src/conf.c
	src/context.c
	src/database.c
	src/loop.c
	src/mosquitto.c
	src/mosquitto_broker.h
	src/net.c
	src/read_handle.c
	src/read_handle_server.c
	src/subs.c
2015-09-09 22:02:46 +01:00
Anmol Sarma
a354dd53ae Remove superfluous NULL checks before free()
Change-Id: I39db613c8e75c1437b909de263df4f96a7f76880
Signed-off-by: Anmol Sarma <me@anmolsarma.in>
2015-08-17 20:34:24 +05:30
Roger A. Light
6f88ba3225 Use mosquitto_strerror() instead of displaying the rc. 2015-08-17 11:59:29 +01:00
Roger A. Light
c1974e5402 Report error string on connection failure rather than error code. 2015-06-23 22:59:03 +01:00
Eduardo Sanchez
dae1f95371
Adding a new temporary variable for realloc memory in order to keep the reference to the allocated memory before the function returns.
In case that realloc fails (i.e. OOM), before exiting with "return(1)", the application is still able to free the corresponding allocated memory.

Signed-off-by: Eduardo Sanchez <ledusanchez@gmail.com>
2015-06-01 00:04:31 -03:00
Roger A. Light
8de6b92e3c Fix calls to mosquitto_connect*_async() not completing. 2015-04-29 10:13:55 +01:00
Roger A. Light
2e05e40350 [464458] mosquitto_sub: Add option to print the payload in hex.
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=464458
2015-04-17 22:01:50 +01:00
Roger A. Light
a9cd86f206 Fix usage text. 2015-02-14 13:10:07 +00:00
Roger A. Light
15e0236d43 [453850] Add -C option to mosquitto_sub.
Allows the client to quit after receiving count messages.

Replaces the (unreleased) -1 option.

Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=453850
2015-01-30 22:23:51 +00:00
Roger A. Light
be6a6430dd Fix change in macro name. 2015-01-27 17:09:47 +00:00
Roger A. Light
8a35c3cd0d Add client support for MQTT v3.1.1. 2015-01-27 00:32:20 +00:00
Roger A. Light
b6a0b01e1e [457162] Fix mosquitto_sub not honouring --qos.
Thanks to Christoph Krey.

Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=457162
2015-01-09 21:02:16 +00:00
Roger A. Light
c12d3ebc0b [454852] Support setting keepalive on pub client.
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=454852
2014-12-16 22:53:52 +00:00
Roger A. Light
d9e41fe065 Remove dead code. 2014-11-17 21:00:49 +00:00
Roger A. Light
41f5d1fd43 Fix parsing of malformed socks urls. 2014-11-17 20:18:53 +00:00
Roger A. Light
166bc2c481 Cleanup client memory on error. 2014-11-16 23:41:06 +00:00
Roger A. Light
36f88d902d Fix errors from big code import. 2014-11-12 20:47:16 +00:00
Roger A. Light
0c3e4e50cc Windows implementation of client config files. 2014-10-26 22:06:54 +00:00
Roger A. Light
42420cae46 Add experimental SOCKS5 support for the clients. 2014-09-30 00:56:57 +01:00
Roger A. Light
d9d1f2f7b8 Don't display usage information on every error. 2014-09-10 16:10:53 +01:00
Roger A. Light
65a4b790f3 Check for invalid topics before connecting. 2014-09-10 16:09:15 +01:00
Roger A. Light
ae1477c08f Windows fixes. 2014-07-22 10:28:55 +01:00
Roger A. Light
e6c5f5af7e Add missing usage text. 2014-06-12 22:23:55 +01:00
Roger A. Light
fd7fbba3a5 Use shared config code for debug arg. 2014-05-27 21:48:32 +01:00
Roger A. Light
2db22f3abd Merge 1.3.2 branch in 1.4 branch. 2014-05-26 13:21:20 +01:00
Roger A. Light
58204d984c Fixes for WITH_TLS=no. 2014-05-25 23:41:17 +01:00
Roger A. Light
330a7a882e Add CROSS_COMPILE to Makefiles. 2014-05-25 23:36:38 +01:00
Roger A. Light
aab7a2688c Fix SRV support when building with CMake. 2014-05-19 22:03:26 +01:00
Roger A. Light
cb0e355d9e Only provide srv capabilities ifdef WITH_SRV. 2014-05-19 14:23:38 +01:00
Roger A. Light
dc71f9157d Use $(STRIP) for stripping binaries when installing, to allow easier cross compilation.
Thanks to Frank Pagliughi.
2014-05-08 23:18:50 +01:00
Roger A. Light
0bbdda2c4e Allow comments in config files. 2014-05-25 11:07:01 +01:00
Roger A. Light
7e410eb7f0 CMake fixes for client shared code. 2014-05-25 11:02:31 +01:00
Roger A. Light
a285c6ce5c Add -1 (oneshot) option to mosquitto_sub.
Thanks to JP Mens.
2014-05-25 00:49:08 +01:00
Roger A. Light
fe91e71399 Support client default config files on non Windows. 2014-05-25 00:26:52 +01:00
Roger A. Light
94ec27911b Shared config parsing for client utils. 2014-05-24 23:12:17 +01:00
Roger Light
0364bd1be7 Initial contribution. 2014-05-07 23:27:00 +01:00