Commit Graph

891 Commits

Author SHA1 Message Date
Roger A. Light
a71bee494f HASH_DELETE needs to modify subhier. 2016-09-16 12:46:32 +01:00
Roger A. Light
9ddec11f89 Fix Coverity issue 1362805. 2016-09-15 22:22:28 +01:00
Simon Marchi
97bfa506db Add pkg-config files to CMake build (#213)
This patch adds pkg-config files for libmosquitto and libmosquittopp,
and installs them through CMake.

Refs #107

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
2016-09-10 21:48:50 +01:00
Karl Palsson
374c62586e db_dump: use objects to simplify printing (#215)
Prepratory work for providing more filtering of the output dump.
This makes _no_ difference to the current behaviour, but makes it much
simpler for people who "need", for whatever reason, to hack some private
changes into the db_dump tool.

Signed-off-by: Karl Palsson <karlp@etactica.com>
2016-09-10 13:10:01 +01:00
Roger A. Light
41a1b51c31 Print warning, skip test if paho-mqtt not available. 2016-09-10 09:11:26 +01:00
Roger Light
5cc87f80b4 Merge pull request #200 from remakeelectric/drafts/byte-limits1
Implement byte limits for message queues
2016-09-10 09:08:30 +01:00
Karl Palsson
2dec0ed895 broker: fix queue_qos0_messages behaviour
Prior, offline qos0 clients had an unlimited queue depth when
queue_qos0_messages was true.

Signed-off-by: Karl Palsson <karlp@etactica.com>
2016-09-09 17:27:46 +00:00
Karl Palsson
c6aac741c2 broker: support byte based queueing
Limiting queued message depth purely based on message count is hard to
control for memory constrained devices.  The size of messages can vary
wildly, from a few bytes, to a few kilobytes.  Support a new
max_queued_bytes option, and drop packets when the first limit is
reached.  Option defaults to 0 (disabled) by default.
Support also a max_inflight_bytes variable, with similar behaviour.

Fixes (partof) https://github.com/eclipse/mosquitto/issues/100

This pulls up some helper routines for calculating whether to allow
inflight or queuing, resolving some inconsistences in connection
resumption.

Signed-off-by: Karl Palsson <karlp@etactica.com>
2016-09-09 17:27:39 +00:00
Karl Palsson
03d4b8c270 websockets: fix compatibility with older lws versions (#260)
In 1.3, 1.4 and 1.5, the function was "libwebsockets_get_protocol" not
"libwebsocket_get_protocol"  While the #define name doesn't matter on
newer libwebsockets, where it redirects to lws_get_protocol, the naming
is critical for older versions.

Fixes: 477cd3e399 (Fix missing context->listener for websocket client)

Signed-off-by: Karl Palsson <karlp@etactica.com>
2016-09-08 12:24:29 +01:00
Karl Palsson
642e141c23 conf: max_queued_messages: clarify per client limit
Signed-off-by: Karl Palsson <karlp@etactica.com>
2016-08-17 11:14:31 +00:00
Karl Palsson
8268e6da08 database: drop unnecessary local variable
No need to maintain count and context->msg_count separately.

Signed-off-by: Karl Palsson <karlp@etactica.com>
2016-08-17 11:14:31 +00:00
Karl Palsson
8a48fd13f1 broker: publish initial load averages
This publishes initial 0 figures for all load averages, as is done for
all the existing counter values in the SYS tree.  This makes the
behaviour of certain variables use for diagnostics (stored count for
instance) more predictable, instead of changing due to the creation of
load topics as soon as the load became non-zero.

Signed-off-by: Karl Palsson <karlp@etactica.com>
2016-08-17 11:14:31 +00:00
Karl Palsson
30c96f4a1c broker: track stored messages in bytes as well as count
Instead of simply tracking the count of stored messages, keep track of
the total byte size of stored messages.  While only informational at
this point, it provides the basis for byte based limits in the future.

Signed-off-by: Karl Palsson <karlp@etactica.com>
2016-08-17 10:35:26 +00:00
Karl Palsson
9d00eab64c tests: support generating longer publish packets
Remaining length for publish packets wasn't being handled completely.

Signed-off-by: Karl Palsson <karlp@etactica.com>
2016-08-17 10:27:37 +00:00
Karl Palsson
641158aed9 config: garbage line number if file not found
If the file is not found, showing 0 rather than a garbage number is
mildly better.

Signed-off-by: Karl Palsson <karlp@etactica.com>
2016-08-17 10:27:37 +00:00
Roger A. Light
ee1fd1718b Merge branch 'fixes' 2016-08-16 22:56:28 +01:00
Roger A. Light
87b6a746fd Bump version number. 2016-08-16 22:52:22 +01:00
kcallin
7ba3f3d33b [189] Mosquitto database corrupted on power-loss. (#206)
Mosquitto database writes are not atomic and if power is lost during
a write the file will be permanently lost.  This commit makes writes as
atomic as possible.

Signed-off-by: Keegan Callin <kc@kcallin.net>
Bug: https://github.com/eclipse/mosquitto/issues/189
2016-08-16 22:36:58 +01:00
Roger A. Light
ba2de88790 Display error if broker unable to open the log file.
Thanks to Matthew Treinish.

Bug: https://github.com/eclipse/mosquitto/issues/234
2016-08-16 22:31:36 +01:00
Pierre Fersing
477cd3e399 Fix missing context->listener for websocket client (#239)
The context associated with websocket client didn't had listener
filled, which caused use_username_as_clientid to be ignored.

Signed-off-by: Pierre Fersing <pierre.fersing@bleemeo.com>
2016-08-16 22:10:41 +01:00
Roger A. Light
00aa181749 [244] Add note on compiling auth plugin on OSX.
Closes #244.

Bug: https://github.com/eclipse/mosquitto/issues/244
2016-08-12 08:00:56 +01: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
b1c4171cdc Merge branch 'develop' of github.com:eclipse/mosquitto into develop 2016-08-10 12:22:39 +01:00
Roger A. Light
a0d6da1604 [225] Fix typo in man page.
Closes #225. Thanks to Nabytovych.

Bug: https://github.com/eclipse/mosquitto/issues/225
2016-08-08 22:14:35 +01:00
Roger A. Light
79cc06b180 [237] Fix memory leak when verifying a server certificate.
Only for certificates with a subjectAltName. Closes #237.

Thanks to MrSaturday.

Bug: https://github.com/eclipse/mosquitto/issues/237
2016-08-08 21:49:32 +01:00
Roger A. Light
bcfa29cbd1 [222] Fix will retained flag handling on Windows.
Thanks to codami.

Bug: https://github.com/eclipse/mosquitto/issues/222
2016-07-22 10:37:30 +01:00
Roger A. Light
883af8af53 Better subtree searching. 2016-07-19 15:05:53 +01:00
Roger A. Light
f06a947df2 Update changelog. 2016-07-12 12:37:12 +01:00
Roger A. Light
3261b307e3 Updated readme.md. 2016-07-12 12:36:00 +01:00
tucic
50b26347d4 Writing least significant byte of subscription QoS (#210)
Signed-off-by: Milan Tucic <tucic.milan@gmail.com>
2016-07-12 12:34:59 +01:00
Roger A. Light
0b5d524723 Update defer plugin function signatures. 2016-07-11 14:29:41 +01:00
Roger A. Light
e4db6a760f Backwards compatibility for auth plugins. 2016-07-10 23:17:30 +01:00
Roger A. Light
b40cedaf1d More client accessors. 2016-07-09 21:49:13 +01:00
Roger A. Light
025e56fd4c New mosquitto_auth_psk_key_get() 2016-07-08 13:52:02 +01:00
Roger A. Light
1a6d23feff Bump auth plugin version. 2016-07-08 13:27:31 +01:00
Roger A. Light
b3df015ea7 New mosquitto_unpwd_check(). 2016-07-08 13:27:14 +01:00
Roger A. Light
63f46a999f Add username accessor. 2016-07-08 11:50:50 +01:00
Roger A. Light
ccedc6d709 Moving towards new mosquitto_acl_check(). 2016-07-08 11:26:58 +01:00
Roger A. Light
45ad23c7be mosquitto_broker.h include file for end users. 2016-07-08 10:44:41 +01:00
Roger A. Light
017db6706f Rename mosquitto_broker.h -> mosquitto_broker_internal.h 2016-07-08 10:10:04 +01:00
Roger A. Light
8378fe44cf Update copyrights. 2016-07-08 09:42:24 +01:00
Roger A. Light
56d0f74725 Defer support for TLS-PSK. 2016-07-08 09:36:25 +01:00
Roger A. Light
8fcafcc6aa #define SYS_TREE_QOS 2016-07-08 09:15:28 +01:00
Roger A. Light
1b659b41de sys__ -> sys_tree__ 2016-07-08 09:14:11 +01:00
Roger A. Light
43bcf6799c Move static sys tree entries to sys_tree.c. 2016-07-08 08:46:24 +01:00
Karl Palsson
7cb8988192 websockets: fix compile fail after refactoring (#207)
A lot of function renaming was done in 663d50a016,
and this websockets patch was merged afterwards.  Autobuild testing
doesn't have websockets enabled, and missed this.

Fixes: d9142c3974
Signed-off-by: Karl Palsson <karlp@etactica.com>
2016-07-07 14:19:54 +01:00
Roger A. Light
a04662265a Remove "mosq%d_vacuum" event as vacuum no longer done. 2016-07-03 22:42:43 +01:00
Roger A. Light
d54359598e Move signals/events code to own file. 2016-07-03 22:40:27 +01:00
Dmitry Kaukov
6bf8b59d89 Signalling mosquitto process on Win32, using named events: (#163)
mosqPID_shutdown
mosqPID_reload
mosqPID_backup
mosqPID_vacuum

where PID is the PID of the mosquitto process

Signed-off-by: Dmitry Kaukov <dkaukov@opentable.com>
2016-07-03 22:18:44 +01:00