if (mp->flags & RSPAMD_MULTIPATTERN_UTF8) {
fl |= HS_FLAG_UTF8|HS_FLAG_UCP;
}
+ if (mp->flags & RSPAMD_MULTIPATTERN_DOTALL) {
+ fl |= HS_FLAG_DOTALL;
+ }
+ if (mp->flags & RSPAMD_MULTIPATTERN_SINGLEMATCH) {
+ fl |= HS_FLAG_SINGLEMATCH;
+ fl &= ~HS_FLAG_SOM_LEFTMOST; /* According to hyperscan docs */
+ }
+ if (mp->flags & RSPAMD_MULTIPATTERN_NO_START) {
+ fl &= ~HS_FLAG_SOM_LEFTMOST;
+ }
g_array_append_val (mp->hs_flags, fl);
np = rspamd_multipattern_pattern_filter (pattern, patlen, flags, &dlen);
/* Not supported by acism */
RSPAMD_MULTIPATTERN_GLOB = (1 << 3),
RSPAMD_MULTIPATTERN_RE = (1 << 4),
+ RSPAMD_MULTIPATTERN_DOTALL = (1 << 5),
+ RSPAMD_MULTIPATTERN_SINGLEMATCH = (1 << 6),
+ RSPAMD_MULTIPATTERN_NO_START = (1 << 7),
};
struct rspamd_multipattern;
lua_setfield (L, -2, "utf8");
lua_pushinteger (L, RSPAMD_MULTIPATTERN_TLD);
lua_setfield (L, -2, "tld");
+ lua_pushinteger (L, RSPAMD_MULTIPATTERN_DOTALL);
+ lua_setfield (L, -2, "dot_all");
+ lua_pushinteger (L, RSPAMD_MULTIPATTERN_SINGLEMATCH);
+ lua_setfield (L, -2, "single_match");
+ lua_pushinteger (L, RSPAMD_MULTIPATTERN_NO_START);
+ lua_setfield (L, -2, "no_start");
lua_settable (L, -3);
/* Main content */