Skip to content

Commit

Permalink
tcp: Fix retransmission timeout handling for TCP connections in SYN_R…
Browse files Browse the repository at this point in the history
…CVD state

2.1.3-esp: 6bf7044 bugfix for optimize tcp connection
  • Loading branch information
freakyxue authored and david-cermak committed Sep 11, 2024
1 parent 3462f21 commit b58c966
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,11 @@ tcp_slowtmr(void)
if ((tcp_rexmit_rto_prepare(pcb) == ERR_OK) || ((pcb->unacked == NULL) && (pcb->unsent != NULL))) {
/* Double retransmission time-out unless we are trying to
* connect to somebody (i.e., we are in SYN_SENT). */
#if ESP_LWIP
if (pcb->state != SYN_SENT && pcb->state != SYN_RCVD) {
#else
if (pcb->state != SYN_SENT) {
#endif
u8_t backoff_idx = LWIP_MIN(pcb->nrtx, sizeof(tcp_backoff) - 1);
int calc_rto = ((pcb->sa >> 3) + pcb->sv) << tcp_backoff[backoff_idx];
pcb->rto = (s16_t)LWIP_MIN(calc_rto, 0x7FFF);
Expand Down

0 comments on commit b58c966

Please sign in to comment.