]> source.dussan.org Git - rspamd.git/commitdiff
Fix unix sockets for workers binding.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 5 Dec 2013 13:17:47 +0000 (13:17 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 5 Dec 2013 13:17:47 +0000 (13:17 +0000)
src/cfg_file.h
src/cfg_rcl.c
src/cfg_utils.c

index 40500539df981d4ecd255345972b6f2c8ff639f7..ed45d7d95adc78190590b1bb9e4ebf815dd627d6 100644 (file)
@@ -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
index a33040bfe65ad37fdca7291844a56c881398dc50..5860e13c7b4def260a1d3a1787490a3afd296f5d 100644 (file)
@@ -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);
                }
        }
 
index 0fe898d1644ca10faa407c9d686778aeb8b5d29a..181e44f51ff88a3a0c33daadbc008169943b3af8 100644 (file)
@@ -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;