From 83987babd37638003c635e023913f703522925fa Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sun, 25 Oct 2009 13:54:46 +0100 Subject: filter: add function filter_reload() --- src/filter.c | 12 ++++++++++++ src/filter.h | 1 + 2 files changed, 13 insertions(+) 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); -- cgit v1.2.3