diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-04 16:49:44 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-04 16:49:44 +0100 |
commit | e737e9942cc0c0cbd18dcbc9a1feb0a4b1c48a11 (patch) | |
tree | ba2ee3b7d49e603476dbe15e52d4a8c93c30474b /src/libstat/learn_cache | |
parent | 90f44e8ee59515936df340d5bace8ce68f515870 (diff) | |
download | rspamd-e737e9942cc0c0cbd18dcbc9a1feb0a4b1c48a11.tar.gz rspamd-e737e9942cc0c0cbd18dcbc9a1feb0a4b1c48a11.zip |
[Rework] Set token data as uint64_t instead of chars array
Diffstat (limited to 'src/libstat/learn_cache')
-rw-r--r-- | src/libstat/learn_cache/redis_cache.c | 3 | ||||
-rw-r--r-- | src/libstat/learn_cache/sqlite3_cache.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/libstat/learn_cache/redis_cache.c b/src/libstat/learn_cache/redis_cache.c index cc6e66469..14a90b9d1 100644 --- a/src/libstat/learn_cache/redis_cache.c +++ b/src/libstat/learn_cache/redis_cache.c @@ -197,7 +197,8 @@ rspamd_stat_cache_redis_generate_id (struct rspamd_task *task) for (i = 0; i < task->tokens->len; i ++) { tok = g_ptr_array_index (task->tokens, i); - rspamd_cryptobox_hash_update (&st, tok->data, tok->datalen); + rspamd_cryptobox_hash_update (&st, (guchar *)&tok->data, + sizeof (tok->data)); } rspamd_cryptobox_hash_final (&st, out); diff --git a/src/libstat/learn_cache/sqlite3_cache.c b/src/libstat/learn_cache/sqlite3_cache.c index 48cfe4af7..055950cf4 100644 --- a/src/libstat/learn_cache/sqlite3_cache.c +++ b/src/libstat/learn_cache/sqlite3_cache.c @@ -200,7 +200,8 @@ rspamd_stat_cache_sqlite3_check (struct rspamd_task *task, for (i = 0; i < task->tokens->len; i ++) { tok = g_ptr_array_index (task->tokens, i); - rspamd_cryptobox_hash_update (&st, tok->data, tok->datalen); + rspamd_cryptobox_hash_update (&st, (guchar *)&tok->data, + sizeof (tok->data)); } rspamd_cryptobox_hash_final (&st, out); |