diff --git a/src/core/tcp.c b/src/core/tcp.c index 1993928d..3f3aac94 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -1977,8 +1977,14 @@ tcp_alloc(u8_t prio) /* As initial send MSS, we use TCP_MSS but limit it to 536. The send MSS is updated when an MSS option is received. */ pcb->mss = INITIAL_MSS; +#if ESP_LWIP + /* make TCP's retransmission time to be configurable */ + pcb->rto = LWIP_TCP_RTO_TIME / TCP_SLOW_INTERVAL; + pcb->sv = LWIP_TCP_RTO_TIME / TCP_SLOW_INTERVAL; +#else pcb->rto = 3000 / TCP_SLOW_INTERVAL; pcb->sv = 3000 / TCP_SLOW_INTERVAL; +#endif pcb->rtime = -1; pcb->cwnd = 1; pcb->tmr = tcp_ticks; diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index 3a338d5a..d7e3e7eb 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -1534,6 +1534,11 @@ #define LWIP_ALTCP_TLS 0 #endif +#if ESP_LWIP +#if !defined LWIP_TCP_RTO_TIME || defined __DOXYGEN__ +#define LWIP_TCP_RTO_TIME 3000 +#endif +#endif /** * @} */