From a8f74130a628342ae4b15b548c35a1ede53c888d Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Tue, 31 Jul 2012 14:15:27 +0200 Subject: [PATCH] On connexion loss, log the stamp of the last received packet. This will provide a better starting point to look for events explaining the issue in other logs. --- echoc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/echoc.c b/echoc.c index e3aba49..7b2aedf 100644 --- a/echoc.c +++ b/echoc.c @@ -164,10 +164,10 @@ main(int argc, char *argv[]) seq - last, diff.tv_sec, diff.tv_usec); if (disconnected == 1) { - tm = localtime((time_t *)&now.tv_sec); + tm = localtime((time_t *)&last_ts.tv_sec); strftime(buf, sizeof(buf), "%F %T", tm); printf("%s.%06ld: lost connection\n", - buf, now.tv_usec); + buf, last_ts.tv_usec); } continue; }