From 25e5d3356c2836d51b0bace40dec7805f2c430b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulius=20Ratkevi=C4=8Dius?= Date: Wed, 27 Mar 2019 13:40:05 +0200 Subject: daemon: implemented verbose output on timeout. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Server daemon outputs error message when the client times out into stderr. This commit is part of ticket 3. Signed-off-by: Paulius Ratkevičius --- src/daemon/net.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/daemon/net.c') diff --git a/src/daemon/net.c b/src/daemon/net.c index 225d6d9..98dd154 100644 --- a/src/daemon/net.c +++ b/src/daemon/net.c @@ -180,6 +180,7 @@ static void *dolisten(void * state) /* no packets in five seconds */ if ((now.tv_sec - st->lastreply.tv_sec) >= 5) { st->status = DEAD; + fprintf(stderr, "Connection with the client has been lost. Last reply since: %li", st->lastreply.tv_sec); } else if (st->data[0] != 'I') { /* we don't actually want to have NONEWDATA set from this loop, * barring the one exeption that is after arrival of the beacon -- cgit v1.2.3