mirror of
https://github.com/obgm/libcoap.git
synced 2026-10-30 14:35:48 +03:00
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:
1 parent
5ce12ab656
commit
0583a6734a
1 file changed
+4
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user