mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 00:14:02 +00:00
tcp: fix bug #36167 again (fixed in 2014, but when calling shutdown(WR) followed by recv(), this still happened)
This commit is contained in:
parent
926805bcf1
commit
fa73f130f1
@ -919,7 +919,7 @@ tcp_recved(struct tcp_pcb *pcb, u16_t len)
|
||||
pcb->rcv_wnd = TCP_WND_MAX(pcb);
|
||||
} else if (pcb->rcv_wnd == 0) {
|
||||
/* rcv_wnd overflowed */
|
||||
if ((pcb->state == CLOSE_WAIT) || (pcb->state == LAST_ACK)) {
|
||||
if (TCP_STATE_IS_CLOSING(pcb->state)) {
|
||||
/* In passive close, we allow this, since the FIN bit is added to rcv_wnd
|
||||
by the stack itself, since it is not mandatory for an application
|
||||
to call tcp_recved() for the FIN bit, but e.g. the netconn API does so. */
|
||||
|
@ -66,6 +66,8 @@ enum tcp_state {
|
||||
LAST_ACK = 9,
|
||||
TIME_WAIT = 10
|
||||
};
|
||||
/* ATTENTION: this depends on state number ordering! */
|
||||
#define TCP_STATE_IS_CLOSING(state) ((state) >= FIN_WAIT_1)
|
||||
|
||||
/* Flags for "apiflags" parameter in tcp_write */
|
||||
#define TCP_WRITE_FLAG_COPY 0x01
|
||||
|
Loading…
Reference in New Issue
Block a user