summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-10-25 13:54:46 +0100
committerMichael Adam <obnox@samba.org>2009-10-25 23:33:37 +0100
commit83987babd37638003c635e023913f703522925fa (patch)
tree31a219e2a7f1145a37751179022577e1d80c502b /src
parent79527fb6f71ad0b5fded217266769c0129e059ef (diff)
downloadtinyproxy-83987babd37638003c635e023913f703522925fa.tar.gz
tinyproxy-83987babd37638003c635e023913f703522925fa.zip
filter: add function filter_reload()
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);