From d050c33133e62bf0a9a7584878cf5e7780f226b7 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Tue, 29 Dec 2020 21:35:25 +0100 Subject: [PATCH] tcp_in: Flag the pcb as closing if TCP_EVENT_CLOSED refused Closes https://github.com/espressif/esp-lwip/issues/18 --- src/core/tcp_in.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index 8097bd46..b25027bf 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -541,6 +541,10 @@ tcp_input(struct pbuf *p, struct netif *inp) TCP_EVENT_CLOSED(pcb, err); if (err == ERR_ABRT) { goto aborted; +#if ESP_LWIP + } else if (err == ERR_MEM) { + tcp_set_flags(pcb, TF_CLOSEPEND); +#endif /* ESP_LWIP */ } } }