commit 25086ab: [Minor] Show all listening configurations

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Sep 24 13:00:11 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-09-24 13:58:42 +0100
URL: https://github.com/rspamd/rspamd/commit/25086ab2c3be0d174e319c0088c650cab3bae897 (HEAD -> master)

[Minor] Show all listening configurations

---
 src/libserver/worker_util.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index 14394726d..5ebae998c 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -1125,12 +1125,28 @@ rspamd_handle_child_fork (struct rspamd_worker *wrk,
 	wrk->start_time = rspamd_get_calendar_ticks ();
 
 	if (cf->bind_conf) {
-		msg_info_main ("starting %s process %P (%d); listen on: %s",
+		GString *listen_conf_stringified = g_string_new (NULL);
+		struct rspamd_worker_bind_conf *cur_conf;
+
+		LL_FOREACH (cf->bind_conf, cur_conf) {
+			if (cur_conf->next) {
+				rspamd_printf_gstring (listen_conf_stringified, "%s, ",
+						cur_conf->bind_line);
+			}
+			else {
+				rspamd_printf_gstring (listen_conf_stringified, "%s",
+						cur_conf->bind_line);
+			}
+		}
+
+		msg_info_main ("starting %s process %P (%d); listen on: %v",
 				cf->worker->name,
-				getpid (), wrk->index, cf->bind_conf->bind_line);
+				getpid (), wrk->index, listen_conf_stringified);
+		g_string_free (listen_conf_stringified, TRUE);
 	}
 	else {
-		msg_info_main ("starting %s process %P (%d)", cf->worker->name,
+		msg_info_main ("starting %s process %P (%d); no listen",
+				cf->worker->name,
 				getpid (), wrk->index);
 	}
 	/* Close parent part of socketpair */


More information about the Commits mailing list