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.
This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2026-09-22 17:07:43 +01:00
1 parent 5ce12ab656
commit 0583a6734a
1 file changed
+4
+4
View File
@@ -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;