mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-03 17:36:45 +00:00
Fix clang warning about unreachable code
Do check with preprocessor instead
This commit is contained in:
parent
5d356c96f5
commit
4047702928
@ -73,6 +73,13 @@
|
|||||||
#define TCP_KEEP_INTVL(pcb) TCP_KEEPINTVL_DEFAULT
|
#define TCP_KEEP_INTVL(pcb) TCP_KEEPINTVL_DEFAULT
|
||||||
#endif /* LWIP_TCP_KEEPALIVE */
|
#endif /* LWIP_TCP_KEEPALIVE */
|
||||||
|
|
||||||
|
/* As initial send MSS, we use TCP_MSS but limit it to 536. */
|
||||||
|
#if TCP_MSS > 536
|
||||||
|
#define INITIAL_MSS 536
|
||||||
|
#else
|
||||||
|
#define INITIAL_MSS TCP_MSS
|
||||||
|
#endif
|
||||||
|
|
||||||
const char * const tcp_state_str[] = {
|
const char * const tcp_state_str[] = {
|
||||||
"CLOSED",
|
"CLOSED",
|
||||||
"LISTEN",
|
"LISTEN",
|
||||||
@ -868,7 +875,7 @@ tcp_connect(struct tcp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port,
|
|||||||
pcb->snd_wnd = TCP_WND;
|
pcb->snd_wnd = TCP_WND;
|
||||||
/* As initial send MSS, we use TCP_MSS but limit it to 536.
|
/* As initial send MSS, we use TCP_MSS but limit it to 536.
|
||||||
The send MSS is updated when an MSS option is received. */
|
The send MSS is updated when an MSS option is received. */
|
||||||
pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
|
pcb->mss = INITIAL_MSS;
|
||||||
#if TCP_CALCULATE_EFF_SEND_MSS
|
#if TCP_CALCULATE_EFF_SEND_MSS
|
||||||
pcb->mss = tcp_eff_send_mss(pcb->mss, &pcb->local_ip, &pcb->remote_ip);
|
pcb->mss = tcp_eff_send_mss(pcb->mss, &pcb->local_ip, &pcb->remote_ip);
|
||||||
#endif /* TCP_CALCULATE_EFF_SEND_MSS */
|
#endif /* TCP_CALCULATE_EFF_SEND_MSS */
|
||||||
@ -1524,7 +1531,7 @@ tcp_alloc(u8_t prio)
|
|||||||
pcb->ttl = TCP_TTL;
|
pcb->ttl = TCP_TTL;
|
||||||
/* As initial send MSS, we use TCP_MSS but limit it to 536.
|
/* As initial send MSS, we use TCP_MSS but limit it to 536.
|
||||||
The send MSS is updated when an MSS option is received. */
|
The send MSS is updated when an MSS option is received. */
|
||||||
pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
|
pcb->mss = INITIAL_MSS;
|
||||||
pcb->rto = 3000 / TCP_SLOW_INTERVAL;
|
pcb->rto = 3000 / TCP_SLOW_INTERVAL;
|
||||||
pcb->sv = 3000 / TCP_SLOW_INTERVAL;
|
pcb->sv = 3000 / TCP_SLOW_INTERVAL;
|
||||||
pcb->rtime = -1;
|
pcb->rtime = -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user