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:
DL6ER
2019-11-23 22:59:15 +01:00
parent f9be16e61b
commit e0dc41c76b
3 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -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:
+5 -2
View File
@@ -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++)
{
+1 -1
View File
@@ -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