mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-06 22:44:38 +08: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);
|
pcb->rcv_wnd = TCP_WND_MAX(pcb);
|
||||||
} else if (pcb->rcv_wnd == 0) {
|
} else if (pcb->rcv_wnd == 0) {
|
||||||
/* rcv_wnd overflowed */
|
/* 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
|
/* 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
|
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. */
|
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,
|
LAST_ACK = 9,
|
||||||
TIME_WAIT = 10
|
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 */
|
/* Flags for "apiflags" parameter in tcp_write */
|
||||||
#define TCP_WRITE_FLAG_COPY 0x01
|
#define TCP_WRITE_FLAG_COPY 0x01
|
||||||
|
Loading…
x
Reference in New Issue
Block a user