Commit Graph

1132 Commits

Author SHA1 Message Date
Pierre Hallot
8f0bdd5fd3 Find package libwebsockets if the option is ON.
Otherwise, if the package is not installed, configuration will work, but building will fail.

Signed-off-by: Pierre Hallot <hallotpierre@gmail.com>
2020-12-02 11:54:28 +00:00
Roger A. Light
828e7ae130 More conversion fixes. 2020-12-02 10:41:58 +00:00
Roger A. Light
df1802d8f1 Fix client state conversion warnings. 2020-12-02 10:26:22 +00:00
Roger A. Light
9e6efd2f32 Stop listeners before removing clients to avoid use after free. 2020-12-02 09:41:12 +00:00
Roger A. Light
232a759320 Log client port on new connections.
Closes #1911. Thanks to twegener-embertec.
2020-12-01 22:38:59 +00:00
Roger A. Light
a7f044bcea Respect receive-maximum on bridges. 2020-12-01 21:38:56 +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
ca4b23486b Bridges now obey MQTT v5 server-keepalive. 2020-12-01 16:08:05 +00:00
Roger A. Light
e030ca45cd Fix connack error printing. 2020-12-01 15:57:37 +00:00
Roger A. Light
0c22f475ff Fix bridges incorrectly setting Wills to manage remote notifications.
This is for when `notifications_local_only` was set true.

Closes #1902. Thanks to marcinkowskip.
2020-12-01 14:33:13 +00:00
Roger A. Light
b34dcd2a67 Final remove support for legacy libwebsockets
This means libwebsockets < 2.4.0.
2020-12-01 13:41:14 +00:00
Roger A. Light
c39a42adcc Report an error if the config file is set to a directory.
Closes #1814. Thanks to Odysseus1710.
2020-12-01 12:17:31 +00:00
Roger A. Light
c2f62f03aa Set SSL_OP_SINGLE_DH_USE to protect against weak dhparam primes. 2020-12-01 10:55:00 +00:00
Roger A. Light
b7e6638fd8 Add ciphers_tls1.3 option, to allow setting TLS v1.3 ciphersuites.
Closes #1825. Thanks to Valentin Dimov.
2020-12-01 10:45:10 +00:00
Roger A. Light
13bdd255a1 Fix incorrect array address on error. 2020-11-30 10:31:14 +00:00
Roger A. Light
56b2e35346 Don't kick clients on refused unsubscribe. 2020-11-25 23:25:09 +00:00
Roger A. Light
584cf51ba7 Update to EPL-2.0 2020-11-25 17:34:21 +00:00
Roger A. Light
dac841a342 Better outgoing QoS 0 limiting. 2020-11-25 10:00:45 +00:00
Roger A. Light
c09f8ee3a7 We don't really mind if this fails. 2020-11-24 13:14:34 +00:00
Roger A. Light
05d4766aef Fix plugin callback not being correctly removed. 2020-11-24 13:09:57 +00:00
Roger A. Light
adfa9f1e21 Always zero terminate payloads (removes uhpa support) 2020-11-24 12:24:40 +00:00
Roger A. Light
95c098a807 Integrate debugging only xtreport code. 2020-11-24 12:04:37 +00:00
Roger A. Light
2755fe3c4c Apply limits to QoS 0 outgoing messages. 2020-11-24 12:04:07 +00:00
Roger A. Light
4667c9d5bc Change max_queued_messages default to 1000. 2020-11-24 10:13:21 +00:00
Roger A. Light
0c6365726f Coverity Scan issues.
1436823
1436837
1436843
1432792
1436847
1436848
1436849
2020-11-24 10:06:28 +00:00
Roger A. Light
d142ff69a6 Fix Coverity Scan issues.
511427
1431133
1436823
1436837
1436838
1436929
2020-11-24 00:22:34 +00:00
Roger A. Light
c3ae8c174f Simplify net__socket_accept() use.
Closes Coverity 1436829.
2020-11-23 23:55:15 +00:00
Roger A. Light
4da1f15b41 Fix Coverity Scan errors.
1436854
1436844
2020-11-23 23:41:49 +00:00
Roger A. Light
d26534e22b Fix Coverity scan issues.
1302840
1353078
1431131
1431134
1431135
1436826
1436827
1436828
1436830
1436831
1436834
1436835
1436838
1436839
1436840
1436844
1436846
1436853
1436854
1436859
1436860
1436861
1436863
1436867
2020-11-23 22:05:12 +00:00
Roger A. Light
3aca8c1d8e Guard against libwebsockets assert in 3.2.1 and up. 2020-11-22 23:38:32 +00:00
Roger A. Light
8787ec7b2e Remove non-existant linker functions. 2020-11-20 16:04:39 +00:00
Roger A. Light
b81f0d6782 Set to NULL for safety. 2020-11-18 15:45:10 +00:00
Roger A. Light
524510f4f6 Fix some plugin memory not being freed on exit. 2020-11-18 11:46:10 +00:00
Roger A. Light
f02c67fecf Fix file logging on Windows.
Closes #1880. Thanks to J1EXA, richl, and EnneiteZer.
2020-11-17 11:08:20 +00:00
Roger A. Light
47f4cb8159 Fix potential null dereference. 2020-11-17 11:00:24 +00:00
Roger A. Light
5db9884bac Fix poll() build 2020-11-17 10:51:50 +00:00
Roger A. Light
e7a4e73cd8 Fix listener not being reassociated with client.
This occurred when reloading a persistence file and
`per_listener_settings true` is set and the client did not set a
username.

Closes #1891. Thanks to Mikkel Nepper-Christensen.
2020-11-12 17:36:49 +00:00
Roger A. Light
90ce92144c Fix websockets build. 2020-11-06 18:23:55 +00:00
Roger A. Light
26e8cc3fb9 Fix connack props not being freed on error. 2020-11-06 18:12:12 +00:00
Roger A. Light
8de1216105 No need to call time() when logging. 2020-11-06 17:16:35 +00:00
Roger A. Light
b816d46508 Use db as a global var instead of passing to functions.
This allows a big swath of ifdefs to be removed. It also means savings as the db var is not passed around all of the time, and makes it easier to remove the final broker call to mosquitto_time() call in packet_mosq.c. In one test this reduced the calls to mosquitto_time() from 295k to 48k.
2020-11-06 17:16:23 +00:00
Roger A. Light
108b23ce6d Reduce use of mosquitto_time() and time(). 2020-11-06 14:20:39 +00:00
Roger A. Light
e6b8fc5bbd Fix oversize packet check in CONNECT. 2020-11-06 12:02:43 +00:00
Roger A. Light
3091d624ed Free plugin identifier. 2020-11-06 11:41:33 +00:00
Roger A. Light
c5ba597588 Fix use after free (unreleased) 2020-11-06 11:19:27 +00:00
Roger A. Light
693f6ad36e Only make keepalive checks every 5 seconds. 2020-11-05 21:43:23 +00:00
Roger A. Light
23d3c2641e Optimise epoll event to context/listener mapping. Allows quicker lookups. 2020-11-05 16:10:50 +00:00
Roger A. Light
2a1df4ddb2 Breaking: Drop privileges after loading the configuration
This change means privileges are dropped before loading certificates, starting logging, creating the pid file etc. are carried out, so all of those actions must now be changed to ensure that the unprivileged user can carry them out.
2020-11-05 12:05:07 +00:00
Roger A. Light
c5fee09c24 Basic client disconnect event support for plugins. 2020-11-05 10:52:21 +00:00