From 0583a6734a40ee8f5fdcc3f51e993815f2aa7890 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Tue, 22 Sep 2026 16:51:39 +0100 Subject: [PATCH] coap_block.c: Do not return timeout value of 0 for lg_xmit timeouts This can cause a process to wait forever before retransmitting if there is no input. --- src/coap_block.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/coap_block.c b/src/coap_block.c index 05e4eae4..af9b1add 100644 --- a/src/coap_block.c +++ b/src/coap_block.c @@ -2429,6 +2429,8 @@ coap_block_check_q_block1_xmit(coap_session_t *session, coap_tick_t now, coap_ti if (now <= non_timeout) { /* Too early in the startup cycle to have an accurate response */ *tim_rem = non_timeout - now; + if (*tim_rem < 100) + *tim_rem = 100; return 1; } timed_out = now - non_timeout; @@ -2496,6 +2498,8 @@ coap_block_check_q_block2_xmit(coap_session_t *session, coap_tick_t now, coap_ti if (now <= non_timeout) { /* Too early in the startup cycle to have an accurate response */ *tim_rem = non_timeout - now; + if (*tim_rem < 100) + *tim_rem = 100; return 1; } timed_out = now - non_timeout;