diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-10-07 16:36:03 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-10-07 16:36:03 +0100 |
commit | 59855fcf0fb9a6002182f661dbd0ac298b1d1dd0 (patch) | |
tree | 2c2a2afa73fcae66bd9be90f8e4a0f936255d7c9 | |
parent | 13c6c4d247d3fd486a29c92f05cf05f905eac4d4 (diff) | |
download | rspamd-59855fcf0fb9a6002182f661dbd0ac298b1d1dd0.tar.gz rspamd-59855fcf0fb9a6002182f661dbd0ac298b1d1dd0.zip |
[Minor] Restore full bind_line
-rw-r--r-- | src/libserver/cfg_file.h | 2 | ||||
-rw-r--r-- | src/libserver/cfg_utils.c | 3 | ||||
-rw-r--r-- | src/libserver/worker_util.c | 10 |
3 files changed, 8 insertions, 7 deletions
diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h index d42fbfba9..71d059873 100644 --- a/src/libserver/cfg_file.h +++ b/src/libserver/cfg_file.h @@ -202,7 +202,7 @@ struct rspamd_worker_bind_conf { GPtrArray *addrs; guint cnt; gchar *name; - const gchar *bind_line; + gchar *bind_line; gboolean is_systemd; struct rspamd_worker_bind_conf *next; }; diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c index 2d4da27ac..be709a051 100644 --- a/src/libserver/cfg_utils.c +++ b/src/libserver/cfg_utils.c @@ -86,7 +86,7 @@ rspamd_parse_bind_line (struct rspamd_config *cfg, cnf = g_malloc0 (sizeof (struct rspamd_worker_bind_conf)); cnf->cnt = 1024; - cnf->bind_line = str; + cnf->bind_line = g_strdup (str); if (g_ascii_strncasecmp (str, "systemd:", sizeof ("systemd:") - 1) == 0) { /* The actual socket will be passed by systemd environment */ @@ -1077,6 +1077,7 @@ rspamd_worker_conf_dtor (struct rspamd_worker_conf *wcf) LL_FOREACH_SAFE (wcf->bind_conf, cnf, tmp) { g_free (cnf->name); + g_free (cnf->bind_line); g_ptr_array_free (cnf->addrs, TRUE); g_free (cnf); } diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c index 6c478db6f..7a06988c9 100644 --- a/src/libserver/worker_util.c +++ b/src/libserver/worker_util.c @@ -907,7 +907,7 @@ rspamd_fork_worker (struct rspamd_main *rspamd_main, if (cf->bind_conf) { setproctitle ("%s process (%s)", cf->worker->name, - cf->bind_conf->name); + cf->bind_conf->bind_line); } else { setproctitle ("%s process", cf->worker->name); @@ -933,7 +933,7 @@ rspamd_fork_worker (struct rspamd_main *rspamd_main, if (cf->bind_conf) { msg_info_main ("starting %s process %P (%d); listen on: %s", cf->worker->name, - getpid (), index, cf->bind_conf->name); + getpid (), index, cf->bind_conf->bind_line); } else { msg_info_main ("starting %s process %P (%d)", cf->worker->name, @@ -949,7 +949,7 @@ rspamd_fork_worker (struct rspamd_main *rspamd_main, exit (EXIT_FAILURE); break; case -1: - msg_err_main ("cannot fork main process. %s", strerror (errno)); + msg_err_main ("cannot fork main process: %s", strerror (errno)); if (rspamd_main->pfh) { rspamd_pidfile_remove (rspamd_main->pfh); @@ -969,8 +969,8 @@ rspamd_fork_worker (struct rspamd_main *rspamd_main, ev_child_start (rspamd_main->event_loop, &wrk->cld_ev); rspamd_main_heartbeat_start (wrk, rspamd_main->event_loop); /* Insert worker into worker's table, pid is index */ - g_hash_table_insert (rspamd_main->workers, GSIZE_TO_POINTER ( - wrk->pid), wrk); + g_hash_table_insert (rspamd_main->workers, + GSIZE_TO_POINTER (wrk->pid), wrk); break; } |