#ifdef WITH_HYPERSCAN
enum rspamd_hyperscan_status hyperscan_loaded;
gboolean disable_hyperscan;
- gboolean vectorized_hyperscan;
hs_platform_info_t plt;
#endif
};
rspamd_fstring_t *features = rspamd_fstring_new ();
cache->disable_hyperscan = cfg->disable_hyperscan;
- cache->vectorized_hyperscan = cfg->vectorized_hyperscan;
g_assert (hs_populate_platform (&cache->plt) == HS_SUCCESS);
g_assert (re_class->hs_db != NULL);
/* Go through hyperscan API */
- if (!rt->cache->vectorized_hyperscan) {
- for (i = 0; i < count; i++) {
- cbdata.ins = &in[i];
- cbdata.re = re;
- cbdata.rt = rt;
- cbdata.lens = &lens[i];
- cbdata.count = 1;
- cbdata.task = task;
-
- if ((hs_scan (re_class->hs_db, in[i], lens[i], 0,
- re_class->hs_scratch,
- rspamd_re_cache_hyperscan_cb, &cbdata)) != HS_SUCCESS) {
- ret = 0;
- }
- else {
- ret = rt->results[re_id];
- *processed_hyperscan = TRUE;
- }
- }
- }
- else {
- cbdata.ins = in;
+ for (i = 0; i < count; i++) {
+ cbdata.ins = &in[i];
cbdata.re = re;
cbdata.rt = rt;
- cbdata.lens = lens;
+ cbdata.lens = &lens[i];
cbdata.count = 1;
cbdata.task = task;
- if ((hs_scan_vector (re_class->hs_db, (const char **)in, lens, count, 0,
- re_class->hs_scratch,
- rspamd_re_cache_hyperscan_cb, &cbdata)) != HS_SUCCESS) {
+ if ((hs_scan (re_class->hs_db, in[i], lens[i], 0,
+ re_class->hs_scratch,
+ rspamd_re_cache_hyperscan_cb, &cbdata)) != HS_SUCCESS) {
ret = 0;
}
else {
if (hs_compile (pat,
flags | HS_FLAG_PREFILTER,
- cache->vectorized_hyperscan ? HS_MODE_VECTORED : HS_MODE_BLOCK,
+ HS_MODE_BLOCK,
&cache->plt,
&test_db,
&hs_errors) != HS_SUCCESS) {
if (hs_compile (pat,
hs_flags[i],
- cache->vectorized_hyperscan ? HS_MODE_VECTORED : HS_MODE_BLOCK,
+ HS_MODE_BLOCK,
&cache->plt,
&test_db,
&hs_errors) != HS_SUCCESS) {
hs_ids,
hs_exts,
n,
- cache->vectorized_hyperscan ? HS_MODE_VECTORED : HS_MODE_BLOCK,
+ HS_MODE_BLOCK,
&cache->plt,
&test_db,
&hs_errors) != HS_SUCCESS) {
hs_serialized, serialized_len);
crc = rspamd_cryptobox_fast_hash_final (&crc_st);
- if (cache->vectorized_hyperscan) {
- iov[0].iov_base = (void *) rspamd_hs_magic_vector;
- }
- else {
- iov[0].iov_base = (void *) rspamd_hs_magic;
- }
+ iov[0].iov_base = (void *) rspamd_hs_magic;
iov[0].iov_len = RSPAMD_HS_MAGIC_LEN;
iov[1].iov_base = &cache->plt;
iov[1].iov_len = sizeof (cache->plt);
return FALSE;
}
- if (cache->vectorized_hyperscan) {
- mb = rspamd_hs_magic_vector;
- }
- else {
- mb = rspamd_hs_magic;
- }
+ mb = rspamd_hs_magic;
if (memcmp (magicbuf, mb, sizeof (magicbuf)) != 0) {
msg_err_re_cache ("cannot open hyperscan cache file %s: "