aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/events.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-26 10:09:03 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-26 10:09:03 +0100
commit9f4ebd97d0fbc2bffba13ec945de5e785b15b371 (patch)
treeca7d9ed93f2bc589b7cd8b8ebc039979cbee6a6a /src/libserver/events.c
parent7acc8378f5dcd18281f637f4fd3d2386a99bd50e (diff)
downloadrspamd-9f4ebd97d0fbc2bffba13ec945de5e785b15b371.tar.gz
rspamd-9f4ebd97d0fbc2bffba13ec945de5e785b15b371.zip
Fix hashing.
Diffstat (limited to 'src/libserver/events.c')
-rw-r--r--src/libserver/events.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libserver/events.c b/src/libserver/events.c
index 05d11e2d3..74559872c 100644
--- a/src/libserver/events.c
+++ b/src/libserver/events.c
@@ -25,6 +25,7 @@
#include "config.h"
#include "main.h"
#include "events.h"
+#include "xxhash.h"
#define RSPAMD_SESSION_FLAG_WATCHING (1 << 0)
#define RSPAMD_SESSION_FLAG_DESTROYING (1 << 1)
@@ -73,10 +74,16 @@ rspamd_event_hash (gconstpointer a)
{
const struct rspamd_async_event *ev = a;
XXH64_state_t st;
+ union {
+ event_finalizer_t f;
+ gpointer p;
+ } u;
+
+ u.f = ev->fin;
XXH64_reset (&st, rspamd_hash_seed ());
XXH64_update (&st, ev->user_data, sizeof (gpointer));
- XXH64_update (&st, ev->fin, sizeof (*ev->fin));
+ XXH64_update (&st, &u, sizeof (u));
return XXH64_digest (&st);
}