Commit graph

60 commits

Author SHA1 Message Date
Norbert Heusser
3656b991d5 Refactoring persist-sqlite plugin and moved functionality from
handle_connect.c into database.c

Signed-off-by: Norbert Heusser <norbert.heusser@cedalo.com>
2024-02-15 22:43:28 +00:00
Norbert Heusser
d68dd563db Persist-SQLite: Add new table version_info and addition wal_checkpoint on shutdown
Signed-off-by: Norbert Heusser <norbert.heusser@cedalo.com>
2024-02-15 22:43:28 +00:00
Roger A. Light
fe3b72ef61 Remove a load of cmake boilerplate 2024-02-15 13:39:11 +00:00
Roger A. Light
d17a88d916 Refactor headers for easier discovery. 2023-12-23 12:59:58 +00:00
Roger A. Light
c8e313aac0 Fix build
This is for the case where command line overrides are set.
2023-09-19 22:48:24 +01:00
Roger A. Light
e656e694ed Merge branch 'master' into develop 2023-09-09 15:20:40 +01:00
Roger A. Light
3bb4ff180e Fix Coverity Scan 1509020 Unchecked return value.
This was really a false positive, however the intent is probably clearer
now.
2023-07-09 08:40:02 +01:00
Roger A. Light
a31bee722f Simplify make build. 2023-05-10 16:20:06 +01:00
Roger Light
2b69724ef2 Fix cmake build 2023-04-21 22:38:18 +01:00
Roger A. Light
747fcacd67 Make args const where possible, fix persist-sqlite build. 2023-04-19 22:54:53 +01:00
Roger A. Light
56462c1229 Refactor for more consistent json helper use. 2023-04-19 17:12:20 +01:00
Roger A. Light
da0eab36a4 Remove unused events 2023-01-16 22:49:31 +00:00
Roger A. Light
fd330de080 client_id -> clientid rename. 2023-01-16 18:46:35 +00:00
Roger A. Light
3e17494d34 Rename topic -> topic_filter in events. 2023-01-16 17:17:55 +00:00
Roger A. Light
1081661f74 Refactor client structs. 2023-01-16 10:21:12 +00:00
Roger A. Light
5364410615 Rename members 2023-01-16 10:21:12 +00:00
Roger A. Light
7013a3502d Refactor client_msg structs 2023-01-16 10:21:12 +00:00
Roger A. Light
3634f18bc9 Refactor subscription structs 2023-01-16 10:21:12 +00:00
Roger A. Light
100fd31530 Refactor base_msg structs. 2023-01-16 10:21:12 +00:00
Norbert Heusser
170cd85cec Add target test-compile to all Makefile to allow tests in plugin folders
Signed-off-by: Norbert Heusser <norbert.heusser@cedalo.com>
2022-12-09 18:03:54 +00:00
Roger A. Light
403f6443be Sqlite: Provide logs on restore errors 2022-10-16 21:23:15 +01:00
Roger A. Light
9bb389dda1 Avoid compile error.
"a label can only be part of a statement and a declaration is not a
statement"
2022-10-16 08:13:46 +01:00
Roger A. Light
1a5cd9e849 Fix Coverity Scan 1499794. 2022-10-16 07:39:50 +01:00
Roger A. Light
a872c0466f Fix leak 2022-10-13 20:41:01 +01:00
Roger A. Light
adf985bff8 Persistence: Store cmsg_id and sub id for client_msgs. 2022-10-11 21:51:43 +01:00
Roger A. Light
cfd4aa1c95 sqlite: Consistent naming 2022-10-11 21:50:03 +01:00
Roger A. Light
2bfb0dc022 sqlite: client_msgs are only ever all cleared 2022-10-11 21:49:33 +01:00
Roger A. Light
bdf8493e81 sqlite: base_msg can never have these properties 2022-10-11 21:48:51 +01:00
Roger A. Light
16feb14a57 Persistence interface updates and sqlite plugin fixes
The MOSQ_EVT_PERSIST_CLIENT_MSG_CLEAR event has been removed, due to
never being called. It is the responsibility of the plugin to remove
client subscriptions and client messages when the client is removed.

Lots of persist test improvements and additions - mostly checking item
counts.
2022-10-09 22:17:47 +01:00
Roger A. Light
d4960d0ead sqlite: Save/restore binary properties. 2022-10-09 22:02:59 +01:00
Kai Buschulte
8b67883548 Remove old compatibility header support
Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
2022-08-08 09:25:16 +00:00
Roger A. Light
dd34b707ac Fix Coverity Scan 1490914. 2022-08-01 23:06:23 +01:00
Roger A. Light
ca61baf5e3 Merge branch 'add-common-options-target-to-enable-compiler-warnings' of https://github.com/buschulte/mosquitto into buschulte-add-common-options-target-to-enable-compiler-warnings 2022-07-21 16:21:29 +01:00
Roger A. Light
11b16756cb Windows fixes. 2022-07-21 15:51:52 +01:00
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
8b5a86fd52 Introduce config-header cmake target
This is an interface cmake target which specifies include directories
required by the config.h places in the root of the project.

This header is a "public" header visible to plugins linking the
mosquitto exports.

Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
2022-06-22 23:56:09 +01:00
Roger A. Light
2c8dc3968e Migrate persist-sqlite to use persistence_location. 2022-05-18 15:11:13 +01:00
Roger A. Light
51f9a76f03 Merge branch 'macos-cmake-build' of https://github.com/buschulte/mosquitto into buschulte-macos-cmake-build 2022-05-12 12:10:11 +01:00
Kai Buschulte
7e4746aac4 Fix missing symbols MacOS
Core symbols needed by plugins are now properly linked to their objects

 * Remove link_directories() call:

This specification is not necessary for our own libraries as cmake
shares this information over the targets.

If needed they should be specified target specific, like done for
the external DLT library.

Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
2022-05-11 07:01:22 +00:00
Kai Buschulte
0e9df05d0d Add imported target for cJSON
Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
2022-05-11 07:01:17 +00:00
Kai Buschulte
15208e55cc Use preinstalled CMake find module for SQLite3
CMake >= 3.14 comes with a preinstalled FindSQLite3 module, which now
replaces the self-written one.

Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
2022-05-10 16:44:34 +02:00
Roger A. Light
ab1803d72f Fix casting. 2022-04-29 22:12:55 +01:00
Abilio Marques
82b6eaa31d Persist-sqlite: add flush_period and page_size options
Signed-off-by: Abilio Marques <abiliojr@gmail.com>
2022-04-29 07:35:47 +02:00
Norbert Heusser
d4216c8cb6 Fixed CMakeLists.txt
* Addded missing files plugin_subscribe and plugin_unsubscribe to src/CMakeLists.txt
* Aligned mixed usage of all-keyword and all-plain in target_link_libra…ry definition in in CMakeLists.txt

Signed-off-by: Norbert Heusser <norbert.heusser@cedalo.com>
2022-04-06 10:26:03 +00:00
Roger A. Light
5ab7603811 Fix Coverity Scan 1486934 Unchecked return value 2022-03-24 10:17:15 +00:00
Roger A. Light
27b4a6aa33 Fix Coverity Scan 1487012 Resource leak 2022-03-24 09:06:33 +00:00
Roger A. Light
b3096982b5 Fix Coverity Scan 1486953 Use after free 2022-03-24 08:11:11 +00:00
Roger A. Light
07b7533b1e Fix Coverity Scan 1486947 Double free 2022-03-24 08:11:11 +00:00
Roger A. Light
c661f475b4 Coverity Scan fixes - Invalid type in argument to printf format specifier
1453805
1453806
1486939
1486954
1486955
1486956
1486960
2022-03-24 08:11:11 +00:00
Roger A. Light
7939633114 Optimise persist client msg clearing. 2022-03-18 11:08:18 +00:00