Commit Graph

11 Commits

Author SHA1 Message Date
DL6ER 1b15885c0f Check struct sizes on the CI (in code) instead of during compile time (using the preprocessor)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-04-18 10:39:43 +02:00
DL6ER eb8de5f0f2 Fix a memory leak when re-opening the databases (when forking or reloading the lists). The memory leak is on the order of a few bytes but scales quickly with the number of clients. It is caused by SQLite3 not being able to clean up behind itself when we're not finalizing and closing everything explicitly.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-03-16 11:37:13 +01:00
DL6ER 50d182950a Statically assert struct sizes are what we expect. This prevents us from increasing the memory needs unintentionally (e.g. due to sub-optimal padding)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-18 14:29:03 +01:00
DL6ER 536ef08ce5 Free allocated memory after ordinary termination of TCP workers (TCP connection closed)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-04-06 15:11:32 +02:00
DL6ER c9eb4a1265 Remove append and delete instructions as we will always identify clients exactly by their IDs
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-04-06 13:08:02 +02:00
DL6ER 3aa6edcf07 Implement process-private prepared gravity database client statements. This fixes an incompatibility across forks when serving TCP traffic using dedicated workers.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-04-06 12:17:04 +02:00
DL6ER c9c7c27888 Add shared DNS cache for FTL. This cache is shared across forks and can be used by TCP and UDP clients avoiding any doubled amount of work.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-30 14:08:22 +00:00
DL6ER 8d28bf4b55 Remove commented out generic vector implementation.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-11 21:19:41 +00:00
DL6ER faac7005d1 Improve performance significantly. We store if (and if: why) a certain domain was blocked for any requesting client and can immediately reply similarly if the same client requests the same domain again. This reduces the O(N^3) problem (number of queries * number of domains * number of clients) to a O(N^2) problem (domains * clients). Note that this state of the code still lacks a possibility to reset when entries in the database have changed. For this, we still have to send either SIGHUP (drawback: clears the cache) or define a new signal for it.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-11-22 09:42:06 +01:00
DL6ER 7fd801dbc2 Add pure attribute to vGet() to signal that this function might be eliminated without consequences in static data flow analysis.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-11-21 12:18:53 +01:00
DL6ER 0baa56c3c3 Add a generic dynamic vector implementation. I tested my implementation using gdb and also against valgrind to ensure there are no memory leaks.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-11-21 12:12:26 +01:00