diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-02-02 22:53:26 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-02-02 22:53:26 +0000 |
commit | fec4b654dbc8e4fc98984a669b5ff88be5ed0976 (patch) | |
tree | bae975d1f23ae9d15683df810ac8f372753441eb /src/worker.c | |
parent | f1718ac5923a555efb0bfcac4c1859e6a9ac87c9 (diff) | |
download | rspamd-fec4b654dbc8e4fc98984a669b5ff88be5ed0976.tar.gz rspamd-fec4b654dbc8e4fc98984a669b5ff88be5ed0976.zip |
Use keypairs cache.
Diffstat (limited to 'src/worker.c')
-rw-r--r-- | src/worker.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/worker.c b/src/worker.c index e55483daf..7a94ee77e 100644 --- a/src/worker.c +++ b/src/worker.c @@ -36,6 +36,7 @@ #include "libserver/dns.h" #include "libmime/message.h" #include "main.h" +#include "keypairs_cache.h" #include "lua/lua_common.h" @@ -88,6 +89,8 @@ struct rspamd_worker_ctx { struct event_base *ev_base; /* Encryption key */ gpointer key; + /* Keys cache */ + struct rspamd_keypair_cache *keys_cache; }; /* @@ -237,7 +240,8 @@ accept_socket (gint fd, short what, void *arg) rspamd_worker_error_handler, rspamd_worker_finish_handler, 0, - RSPAMD_HTTP_SERVER); + RSPAMD_HTTP_SERVER, + ctx->keys_cache); new_task->ev_base = ctx->ev_base; ctx->tasks++; rspamd_mempool_add_destructor (new_task->task_pool, @@ -352,6 +356,9 @@ start_worker (struct rspamd_worker *worker) } } + /* XXX: stupid default */ + ctx->keys_cache = rspamd_keypair_cache_new (256); + event_base_loop (ctx->ev_base, 0); g_mime_shutdown (); @@ -361,6 +368,8 @@ start_worker (struct rspamd_worker *worker) rspamd_http_connection_key_unref (ctx->key); } + rspamd_keypair_cache_destroy (ctx->keys_cache); + exit (EXIT_SUCCESS); } |