From 6bf7044c0368d587f70f7083e39e0a619b4d5788 Mon Sep 17 00:00:00 2001 From: xueyunfei Date: Wed, 2 Aug 2023 10:59:26 +0800 Subject: [PATCH] bugfix for optimize tcp connection --- src/core/tcp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/tcp.c b/src/core/tcp.c index cfd0cd922..3fbdd89ae 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -1290,7 +1290,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);