Commit graph

130 commits

Author SHA1 Message Date
Kai Buschulte
71456077ad Introduce a common-options cmake target
this makes it possible to explicitly share compile options, without
using the `add_definition` function. This function declares options for
the current directory and below (in our case also for `deps`).

Adding -Wall, -Wconversion and -Wextra to at least make compiler
warnings visible for the cmake build.

Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
2022-07-04 11:16:01 +02:00
Kai Buschulte
a883bda9c1 Add CMake test target
Use `ctest` or `make test` to run all tests.
With this it's also possible to run tests on a Mac.

Relative paths used in tests become absolute ones to make tests
executable from any build folder.

Also fixed race condition in
  test/broker/11-persistent-subscription-no-local.py

Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
2022-06-22 23:56:50 +01:00
Roger A. Light
4487b98dbb Fix clean 2022-05-08 21:53:14 +01:00
Roger A. Light
b4a0255f1c Process retain persist events only every 10 seconds. 2022-03-01 21:17:18 +00:00
Roger A. Light
cbb01193a0 Rename persist retain_add to retain_set 2022-03-01 20:55:56 +00:00
Roger A. Light
2d3b152a22 Rename of mosquitto_msg_store struct.
struct mosquitto_msg_store -> struct mosquitto_base_msg

This is the base message which client messages and retained messages
refer to. The base messages are still held in the message store.

This change comes about because the persistence interface exposes these
message types. Prior to this commit the different messages were "msg",
"client_msg", and "retain". After this commit there is "base_msg",
"client_msg", and and "retain_msg" in the persist interface.
2022-03-01 10:44:47 +00:00
Roger A. Light
ffb7661d86 Move shared code to common directory
This is currently limited to "utility" type functions and does not include code common to the library and broker that are protocol related.
2022-02-09 16:26:10 +00:00
Roger A. Light
5a3b42d4a4 Use path vars in Makefiles. 2022-02-09 14:44:09 +00:00
Roger A. Light
df2a4a666f Add missing hunk from previous commit. 2022-02-01 16:21:45 +00:00
Roger A. Light
6f8ced5038 Test fixes. 2022-02-01 09:52:41 +00:00
Roger A. Light
d546ba461a Test fixes. 2022-01-05 09:15:02 +00:00
Roger A. Light
6e8925c062 Test fix. 2021-12-30 08:05:09 +00:00
Roger A. Light
0f8733627a Plugin persistence interface. 2021-11-24 19:26:07 +00:00
Roger A. Light
2501a64035 Merge branch 'master' into develop 2021-11-23 12:53:50 +00:00
Roger A. Light
affe6ece83 Add client msg int to allow easier ordering for plugins. 2021-11-18 10:13:28 +00:00
Roger A. Light
11975332d4 Fix mosquitto_topic_matches_sub2() not using the length parameters.
Closes #2364. Thanks to Jens Alfke.
2021-11-16 23:14:24 +00:00
Roger A. Light
0d0a36906c Add missing stubs. 2021-11-16 22:14:19 +00:00
Roger A. Light
e09390eda6 Split db__message_insert into incoming/outgoing. 2021-11-11 14:47:02 +00:00
Roger A. Light
9ad8d943be Stored messages now always stored in a hash table. 2021-11-11 11:20:30 +00:00
Roger A. Light
a1288721ce Fix tests 2021-10-27 17:22:58 +01:00
Roger A. Light
8ac11929cc Merge branch 'master' into develop 2021-10-27 17:19:33 +01:00
Roger A. Light
b9b065d2cc Compiler pedantry, and more checks in tests. 2021-10-14 11:39:46 +01:00
Roger Light
9d3f292b39 Send DISCONNECT With session-takeover return code.
This is for MQTT v5 clients when a client connects with the same client id.

Closes #2340. Thanks to hvxl.
2021-10-12 23:20:53 +01:00
Roger Light
51eda2bf79 Add more efficient keepalive check. 2021-10-12 17:19:42 +01:00
Roger A. Light
a1a190b482 Pointless whitespace tidy. 2021-10-05 15:20:37 +01:00
Roger A. Light
c28110d079 Fix test 2021-10-01 17:24:19 +01:00
Roger A. Light
aa29b45e70 Merge branch 'master' into develop 2021-09-07 19:17:11 +01:00
Roger Light
ba2ca33671 Strict protocol compliance fixes, and extensive test suite. 2021-08-23 23:19:28 +01:00
Roger A. Light
a02aad0a9c Add mosquitto_sub_matches_acl_with_pattern. 2021-07-08 17:45:50 +01:00
Roger A. Light
f90e55bd36 Reduce memory allocations when sending packets. 2021-06-30 14:53:34 +01:00
Roger A. Light
e0309acebc Add mosquitto_sub_matches_acl()
This moves the sub matching sub code from the dynsec plugin to the library and broker, and removes all of the malloc calls at the same time.
2021-06-10 22:19:39 +01:00
Roger A. Light
b3045d1adf Fix pattern matching with invalid prefix. 2021-06-10 22:19:39 +01:00
Roger A. Light
6502d6e5f4 Add mosquitto_topic_matches_sub_with_pattern()
And use it in the default security checks.
2021-06-10 15:33:01 +01:00
Roger A. Light
906a515704 Simplify client message properties, only one is used. 2021-06-02 15:15:01 +01:00
Roger A. Light
fb76fd66b9 Remove some unused struct members. 2021-06-02 15:15:01 +01:00
Roger A. Light
5177dd4d40 Use random last db id, unless later overwritten by persistence. 2021-05-27 11:22:02 +01:00
Roger Light
0eb7391e71 Fix tests and db_dump compilation. 2021-05-06 00:06:58 +01:00
Roger A. Light
8a03b5ad5c Function for checking if a context is connected. 2021-05-02 23:19:54 +01:00
Roger Light
fecf550cad Fix test. 2021-03-14 13:13:44 +00:00
Roger A. Light
706a1f3f29 Fix more minor compiler warnings. 2021-01-21 13:33:54 +00:00
Roger A. Light
fdd624cec4 Fix tests now uhpa has been removed. 2020-11-25 09:19:05 +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
4d9afc835b Fix missing functions in test. 2020-11-05 09:06:51 +00:00
Roger A. Light
899695261a Fix invalid character conversions in test. 2020-10-21 13:19:28 +01:00
Roger A. Light
4f61f6c161 Fix conversion errors. 2020-10-17 01:23:08 +01:00
Roger A. Light
a65f946e83 Move headers to own directory. 2020-10-07 22:06:01 +01:00
Roger A. Light
c90e49af1b Merge remote-tracking branch 'origin/fixes' into develop 2020-09-24 17:03:14 +01:00
Roger A. Light
54b9571516 Enable TLS with certfile+keyfile, not capath/cafile. 2020-09-23 23:31:00 +01:00
Roger Light
58aa41c813 Optimise use of db__message_write()
New messages are now queued for clients when old ones are sent, rather than on every iteration of the main loop. This produces good performance improvements.
2020-08-12 15:29:08 +01:00
david-beinder
c11d20f82c Database v6 tests
keep v5 client read test to test for backwards compatability
adds username="usrname" and listener_port=1883 for v6 tests

Signed-off-by: david-beinder <david.beinder@mce.li>
2020-08-07 08:56:52 +02:00