From 2b4dde84e3797390adc6fe5abd3c28160e3224a3 Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Fri, 5 Jan 2018 11:43:48 +0100 Subject: [PATCH] Apply modified patch #9533: sys_check_timeouts: recalculate the time diff after each handler call Adapted to new timer implementation --- src/core/timeouts.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/timeouts.c b/src/core/timeouts.c index 746b1e9d..90a5568e 100644 --- a/src/core/timeouts.c +++ b/src/core/timeouts.c @@ -317,11 +317,11 @@ sys_check_timeouts(void) u8_t had_one; u32_t now; - now = sys_now(); do { PBUF_CHECK_FREE_OOSEQ(); had_one = 0; tmptimeout = next_timeout; + now = sys_now(); if (tmptimeout && TIMER_LESS_THAN(tmptimeout, now)) { /* timeout has expired */ had_one = 1; @@ -342,6 +342,9 @@ sys_check_timeouts(void) } /* repeat until all expired timers have been called */ } while (had_one); + } else { + PBUF_CHECK_FREE_OOSEQ(); + LWIP_TCPIP_THREAD_ALIVE(); } }