aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/http.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-24 12:24:55 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-24 12:43:04 +0100
commit7a589308b47e6eb84bd94afd5382d5d1e86bbcbe (patch)
treeac5dbd6bdcb16cbd2aa62e1022e52ad1af73fa68 /src/libutil/http.h
parent7b84e095b24fb2b7d4c0912a09397fdf489c61a7 (diff)
downloadrspamd-7a589308b47e6eb84bd94afd5382d5d1e86bbcbe.tar.gz
rspamd-7a589308b47e6eb84bd94afd5382d5d1e86bbcbe.zip
[Minor] Allow regexp patterns for HTTP router
Diffstat (limited to 'src/libutil/http.h')
-rw-r--r--src/libutil/http.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libutil/http.h b/src/libutil/http.h
index 399141e60..f02c01a04 100644
--- a/src/libutil/http.h
+++ b/src/libutil/http.h
@@ -127,6 +127,7 @@ struct rspamd_http_connection_entry {
struct rspamd_http_connection_router {
struct rspamd_http_connection_entry *conns;
GHashTable *paths;
+ GPtrArray *regexps;
struct timeval tv;
struct timeval *ptv;
struct event_base *ev_base;
@@ -456,6 +457,15 @@ void rspamd_http_router_set_key (struct rspamd_http_connection_router *router,
void rspamd_http_router_add_path (struct rspamd_http_connection_router *router,
const gchar *path, rspamd_http_router_handler_t handler);
+struct rspamd_regexp_s;
+/**
+ * Adds new pattern to router, regexp object is refcounted by this function
+ * @param router
+ * @param re
+ * @param handler
+ */
+void rspamd_http_router_add_regexp (struct rspamd_http_connection_router *router,
+ struct rspamd_regexp_s *re, rspamd_http_router_handler_t handler);
/**
* Handle new accepted socket
* @param router router object