summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/filter.c12
-rw-r--r--src/filter.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/filter.c b/src/filter.c
index 9f88430..e0e5f9e 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -150,6 +150,18 @@ void filter_destroy (void)
}
}
+/**
+ * reload the filter file if filtering is enabled
+ */
+void filter_reload (void)
+{
+ if (config.filter) {
+ log_message (LOG_NOTICE, "Re-reading filter file.");
+ filter_destroy ();
+ filter_init ();
+ }
+}
+
/* Return 0 to allow, non-zero to block */
int filter_domain (const char *host)
{
diff --git a/src/filter.h b/src/filter.h
index 6305a36..8c6f270 100644
--- a/src/filter.h
+++ b/src/filter.h
@@ -28,6 +28,7 @@ typedef enum {
extern void filter_init (void);
extern void filter_destroy (void);
+extern void filter_reload (void);
extern int filter_domain (const char *host);
extern int filter_url (const char *url);