aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-14 17:36:27 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-14 17:36:27 +0100
commit590fea4d3ffc85e1a8c57a5d550d7bf46c79eb7d (patch)
treec8d007ae4fc42028cfd1ac0e17b919dc0186fc6e
parent11ca56b853bebb6cec3fa89fc183ac83e1a2f35e (diff)
downloadrspamd-590fea4d3ffc85e1a8c57a5d550d7bf46c79eb7d.tar.gz
rspamd-590fea4d3ffc85e1a8c57a5d550d7bf46c79eb7d.zip
[Fix] Some more fixes for urls parser
-rw-r--r--src/libserver/url.c7
-rw-r--r--src/libutil/multipattern.c3
2 files changed, 6 insertions, 4 deletions
diff --git a/src/libserver/url.c b/src/libserver/url.c
index 9d6ec34bf..e3bdf7e7c 100644
--- a/src/libserver/url.c
+++ b/src/libserver/url.c
@@ -416,8 +416,6 @@ rspamd_url_add_static_matchers (struct url_match_scanner *sc)
{
gint n = G_N_ELEMENTS (static_matchers), i;
- g_array_append_vals (sc->matchers, static_matchers, n);
-
for (i = 0; i < n; i++) {
if (static_matchers[i].flags & URL_FLAG_REGEXP) {
rspamd_multipattern_add_pattern (url_scanner->search_trie,
@@ -432,6 +430,8 @@ rspamd_url_add_static_matchers (struct url_match_scanner *sc)
static_matchers[i].patlen = strlen (static_matchers[i].pattern);
}
+
+ g_array_append_vals (sc->matchers, static_matchers, n);
}
void
@@ -2003,6 +2003,7 @@ static gboolean
rspamd_url_trie_is_match (struct url_matcher *matcher, const gchar *pos,
const gchar *end)
{
+#ifndef WITH_HYPERSCAN
if (matcher->flags & URL_FLAG_TLD_MATCH) {
/* Immediately check pos for valid chars */
if (pos < end) {
@@ -2024,7 +2025,7 @@ rspamd_url_trie_is_match (struct url_matcher *matcher, const gchar *pos,
}
}
}
-
+#endif
return TRUE;
}
diff --git a/src/libutil/multipattern.c b/src/libutil/multipattern.c
index d8cbd77d9..838191363 100644
--- a/src/libutil/multipattern.c
+++ b/src/libutil/multipattern.c
@@ -17,6 +17,7 @@
#include "config.h"
#include "libutil/multipattern.h"
#include "libutil/str_util.h"
+#include "logger.h"
#ifdef WITH_HYPERSCAN
#include "hs.h"
@@ -398,7 +399,7 @@ rspamd_multipattern_add_pattern (struct rspamd_multipattern *mp,
fl |= HS_FLAG_CASELESS;
}
if (mp->flags & RSPAMD_MULTIPATTERN_UTF8) {
- fl |= HS_FLAG_UTF8;
+ fl |= HS_FLAG_UTF8|HS_FLAG_UCP;
}
g_array_append_val (mp->hs_flags, fl);