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.
This commit is contained in:
Matthieu Herrb 2012-07-31 14:15:27 +02:00
parent b1bb8de8e2
commit a8f74130a6

View file

@ -164,10 +164,10 @@ main(int argc, char *argv[])
seq - last, diff.tv_sec, diff.tv_usec); seq - last, diff.tv_sec, diff.tv_usec);
if (disconnected == 1) { 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); strftime(buf, sizeof(buf), "%F %T", tm);
printf("%s.%06ld: lost connection\n", printf("%s.%06ld: lost connection\n",
buf, now.tv_usec); buf, last_ts.tv_usec);
} }
continue; continue;
} }