From 314ceb04b4f45b69b2bd4dab20debaf5f2e685d2 Mon Sep 17 00:00:00 2001 From: Selva Nair Date: Thu, 14 Jul 2022 20:34:53 -0400 Subject: [PATCH] Show a message if waiting for management interface When retrying connect() on management socket, log a message. Especially useful when waiting for a persistent daemon to come up after an unexpected exit or service disconnect. Signed-off-by: Selva Nair --- manage.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/manage.c b/manage.c index 682b2e0..1830d03 100644 --- a/manage.c +++ b/manage.c @@ -208,6 +208,15 @@ OnManagement(SOCKET sk, LPARAM lParam) if (c->flags & FLAG_DAEMON_PERSISTENT || time(NULL) < c->manage.timeout) { + /* show a message on status window */ + if (rtmsg_handler[log_] && (c->flags & FLAG_DAEMON_PERSISTENT)) + { + char buf[256]; + _snprintf_0(buf, "%lld,W,Waiting for the management interface to come up", + (long long)time(NULL)) + rtmsg_handler[log_](c, buf); + } + connect(c->manage.sk, (SOCKADDR *)&c->manage.skaddr, sizeof(c->manage.skaddr)); } else