mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-09-13 10:15:43 +00:00
tcp_enqueue_flags: no need to check pcb->snd_queuelen
We only allow SYN or FIN in this functions and FIN shall always come through, so no need to check pcb->snd_queuelen
This commit is contained in:
parent
d6cf8a3e38
commit
83ff2014ae
@ -839,16 +839,7 @@ tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags)
|
|||||||
|
|
||||||
LWIP_ASSERT("tcp_enqueue_flags: need either TCP_SYN or TCP_FIN in flags (programmer violates API)",
|
LWIP_ASSERT("tcp_enqueue_flags: need either TCP_SYN or TCP_FIN in flags (programmer violates API)",
|
||||||
(flags & (TCP_SYN | TCP_FIN)) != 0);
|
(flags & (TCP_SYN | TCP_FIN)) != 0);
|
||||||
|
/* No need to check pcb->snd_queuelen if only SYN or FIN are allowed! */
|
||||||
/* check for configured max queuelen and possible overflow (FIN flag should always come through!) */
|
|
||||||
if (((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) &&
|
|
||||||
((flags & TCP_FIN) == 0)) {
|
|
||||||
LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("tcp_enqueue_flags: too long queue %"U16_F" (max %"U16_F")\n",
|
|
||||||
pcb->snd_queuelen, (u16_t)TCP_SND_QUEUELEN));
|
|
||||||
TCP_STATS_INC(tcp.memerr);
|
|
||||||
tcp_set_flags(pcb, TF_NAGLEMEMERR);
|
|
||||||
return ERR_MEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flags & TCP_SYN) {
|
if (flags & TCP_SYN) {
|
||||||
optflags = TF_SEG_OPTS_MSS;
|
optflags = TF_SEG_OPTS_MSS;
|
||||||
|
Loading…
Reference in New Issue
Block a user