From: Vsevolod Stakhov Date: Thu, 5 Dec 2013 13:17:47 +0000 (+0000) Subject: Fix unix sockets for workers binding. X-Git-Tag: 0.6.2~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2ca6e26fe2e657023e53e50598f9b3b5eef39e23;p=rspamd.git Fix unix sockets for workers binding. --- diff --git a/src/cfg_file.h b/src/cfg_file.h index 40500539d..ed45d7d95 100644 --- a/src/cfg_file.h +++ b/src/cfg_file.h @@ -415,7 +415,7 @@ gboolean parse_host_priority (memory_pool_t *pool, const gchar *str, gchar **add * @param type type of credits * @return 1 if line was successfully parsed and 0 in case of error */ -gboolean parse_bind_line (struct config_file *cfg, struct worker_conf *cf, gchar *str); +gboolean parse_bind_line (struct config_file *cfg, struct worker_conf *cf, const gchar *str); /** * Init default values diff --git a/src/cfg_rcl.c b/src/cfg_rcl.c index a33040bfe..5860e13c7 100644 --- a/src/cfg_rcl.c +++ b/src/cfg_rcl.c @@ -437,7 +437,6 @@ rspamd_rcl_worker_handler (struct config_file *cfg, ucl_object_t *obj, const gchar *worker_type, *worker_bind; GQuark qtype; struct worker_conf *wrk; - struct rspamd_worker_bind_conf *bcf; struct rspamd_worker_cfg_parser *wparser; struct rspamd_worker_param_parser *whandler; @@ -475,13 +474,10 @@ rspamd_rcl_worker_handler (struct config_file *cfg, ucl_object_t *obj, if (!ucl_object_tostring_safe (cur, &worker_bind)) { continue; } - bcf = memory_pool_alloc0 (cfg->cfg_pool, sizeof (struct rspamd_worker_bind_conf)); - if (!parse_host_port_priority (cfg->cfg_pool, worker_bind, &bcf->bind_host, - &bcf->bind_port, NULL)) { + if (!parse_bind_line (cfg, wrk, worker_bind)) { g_set_error (err, CFG_RCL_ERROR, EINVAL, "cannot parse bind line: %s", worker_bind); return FALSE; } - LL_PREPEND (wrk->bind_conf, bcf); } } diff --git a/src/cfg_utils.c b/src/cfg_utils.c index 0fe898d16..181e44f51 100644 --- a/src/cfg_utils.c +++ b/src/cfg_utils.c @@ -164,7 +164,7 @@ parse_host_priority (memory_pool_t *pool, const gchar *str, gchar **addr, guint } gboolean -parse_bind_line (struct config_file *cfg, struct worker_conf *cf, gchar *str) +parse_bind_line (struct config_file *cfg, struct worker_conf *cf, const gchar *str) { struct rspamd_worker_bind_conf *cnf;