From e737e9942cc0c0cbd18dcbc9a1feb0a4b1c48a11 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 4 Apr 2017 16:49:44 +0100 Subject: [Rework] Set token data as uint64_t instead of chars array --- src/libstat/learn_cache/redis_cache.c | 3 ++- src/libstat/learn_cache/sqlite3_cache.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libstat/learn_cache') 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); -- cgit v1.2.3