mirror of
https://github.com/pi-hole/FTL.git
synced 2024-10-26 16:52:18 +02:00
Also reset per-client domain data on receipt of SIGHUP. The user expects all cache to be cleared on this signal.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -1413,7 +1413,7 @@ static void async_event(int pipe, time_t now)
|
||||
if (daemon->log_file != NULL)
|
||||
log_reopen(daemon->log_file);
|
||||
|
||||
FTL_reset_per_client_domain_data();
|
||||
FTL_reset_per_client_domain_data(true);
|
||||
break;
|
||||
|
||||
case EVENT_NEWADDR:
|
||||
|
||||
@@ -596,6 +596,8 @@ void FTL_dnsmasq_reload(void)
|
||||
// only after having called gravityDB_open()
|
||||
read_regex_from_database();
|
||||
|
||||
FTL_reset_per_client_domain_data(false);
|
||||
|
||||
// Print current set of capabilities if requested via debug flag
|
||||
if(config.debug & DEBUG_CAPS)
|
||||
check_capabilities();
|
||||
@@ -1557,9 +1559,10 @@ static void prepare_blocking_metadata(void)
|
||||
clearSetupVarsArray();
|
||||
}
|
||||
|
||||
void FTL_reset_per_client_domain_data(void)
|
||||
void FTL_reset_per_client_domain_data(bool sigusr2)
|
||||
{
|
||||
logg("Received SIGUSR2, resetting domain blocking data");
|
||||
if(sigusr2)
|
||||
logg("Received SIGUSR2, resetting domain blocking data");
|
||||
|
||||
for(int domainID = 0; domainID < counters->domains; domainID++)
|
||||
{
|
||||
|
||||
@@ -49,6 +49,6 @@ void _FTL_get_blocking_metadata(struct all_addr **addrp, unsigned int *flags, co
|
||||
void FTL_dnsmasq_reload(void);
|
||||
void FTL_fork_and_bind_sockets(struct passwd *ent_pw);
|
||||
|
||||
void FTL_reset_per_client_domain_data(void);
|
||||
void FTL_reset_per_client_domain_data(bool sigusr2);
|
||||
|
||||
#endif // DNSMASQ_INTERFACE_H
|
||||
|
||||
Reference in New Issue
Block a user