update discard pre 2016 date if post 2016 date seen
Otherwise lwsws started at boot on a system without an RTC may feel it was started in 1970, and when the clock is set by ntpd a little later, has been up for 16,000 days... Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
92b0d8a614
commit
3a42fb545a
1 changed files with 7 additions and 0 deletions
|
@ -675,6 +675,13 @@ lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd, int t
|
||||||
|
|
||||||
time(&now);
|
time(&now);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* handle case that system time was uninitialized when lws started
|
||||||
|
* at boot, and got initialized a little later
|
||||||
|
*/
|
||||||
|
if (context->time_up < 1464083026 && now > 1464083026)
|
||||||
|
context->time_up = now;
|
||||||
|
|
||||||
/* TODO: if using libev, we should probably use timeout watchers... */
|
/* TODO: if using libev, we should probably use timeout watchers... */
|
||||||
if (context->last_timeout_check_s != now) {
|
if (context->last_timeout_check_s != now) {
|
||||||
context->last_timeout_check_s = now;
|
context->last_timeout_check_s = now;
|
||||||
|
|
Loading…
Add table
Reference in a new issue