Skip to content

Commit

Permalink
Show a message if waiting for management interface
Browse files Browse the repository at this point in the history
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 <selva.nair@gmail.com>
  • Loading branch information
selvanair committed Aug 8, 2022
1 parent 44990cd commit 314ceb0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions manage.c
Expand Up @@ -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
Expand Down

0 comments on commit 314ceb0

Please sign in to comment.