Skip to content

Commit

Permalink
bugfix for optimize tcp connection
Browse files Browse the repository at this point in the history
  • Loading branch information
freakyxue committed Oct 13, 2023
1 parent 5c4f899 commit 6bf7044
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 @@ -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);
Expand Down

0 comments on commit 6bf7044

Please sign in to comment.