From: Vsevolod Stakhov Date: Sun, 1 Feb 2015 22:44:20 +0000 (+0000) Subject: Load controller's keypair from configuration. X-Git-Tag: 0.9.0~787 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5a5fae4692f022bafc1b63e4f5747326a05ae636;p=rspamd.git Load controller's keypair from configuration. --- diff --git a/src/controller.c b/src/controller.c index f54d0be03..e54aae0f6 100644 --- a/src/controller.c +++ b/src/controller.c @@ -116,6 +116,9 @@ struct rspamd_controller_worker_ctx { /* Worker */ struct rspamd_worker *worker; + + /* Local keypair */ + gpointer key; }; struct rspamd_controller_session { @@ -1565,6 +1568,11 @@ init_controller_worker (struct rspamd_config *cfg) G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx, static_files_dir), 0); + rspamd_rcl_register_worker_option (cfg, type, "keypair", + rspamd_rcl_parse_struct_keypair, ctx, + G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx, + key), 0); + return ctx; } @@ -1662,6 +1670,10 @@ start_controller_worker (struct rspamd_worker *worker) PATH_COUNTERS, rspamd_controller_handle_counters); + if (ctx->key) { + rspamd_http_router_set_key (ctx->http, ctx->key); + } + /* Attach plugins */ cur = g_list_first (ctx->cfg->filters); while (cur) {