summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-24 16:49:57 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-24 16:49:57 +0100
commitefd981202a374cc75b2d5d1e61b518267e8527d8 (patch)
treeb93d28a00c28eb70a5deda98b2707d082fe590a8 /src/main.c
parente1659e40db3f5da8492bf75a3e270146ce6cca32 (diff)
downloadrspamd-efd981202a374cc75b2d5d1e61b518267e8527d8.tar.gz
rspamd-efd981202a374cc75b2d5d1e61b518267e8527d8.zip
Replace murmur with xxhash32.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c
index 77143d1f0..c1fa93815 100644
--- a/src/main.c
+++ b/src/main.c
@@ -34,6 +34,7 @@
#include "symbols_cache.h"
#include "lua/lua_common.h"
#include "ottery.h"
+#include "xxhash.h"
#ifdef HAVE_OPENSSL
#include <openssl/rand.h>
#include <openssl/err.h>
@@ -652,13 +653,14 @@ fork_delayed (struct rspamd_main *rspamd)
static inline uintptr_t
make_listen_key (gint ai, const gchar *addr, gint port)
{
- uintptr_t res = 0;
+ gpointer xxh;
- res = murmur32_hash (addr, strlen (addr));
- res += murmur32_hash ((guchar *)&ai, sizeof (gint));
- res += murmur32_hash ((guchar *)&port, sizeof (gint));
+ xxh = XXH32_init (0xbeef);
+ XXH32_update (xxh, addr, strlen (addr));
+ XXH32_update (xxh, (guchar *)&ai, sizeof (gint));
+ XXH32_update (xxh, (guchar *)&port, sizeof (gint));
- return res;
+ return XXH32_digest (xxh);
}
static void
@@ -1218,11 +1220,6 @@ main (gint argc, gchar **argv, gchar **env)
pworker++;
}
- /* Init counters */
- rspamd_main->counters = rspamd_hash_new_shared (rspamd_main->server_pool,
- rspamd_str_hash,
- rspamd_str_equal,
- 64);
/* Init listen sockets hash */
listen_sockets = g_hash_table_new (g_direct_hash, g_direct_equal);