From b548abc97c99a7d3f50639b0148fdefebf3f57ab Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Tue, 6 Aug 2019 20:11:14 +0200 Subject: [PATCH 1/2] fix ESPAsyncWebServer/issues/265 in AsyncTCP as well --- src/AsyncTCP.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/AsyncTCP.cpp b/src/AsyncTCP.cpp index 453fa82..c8aad50 100644 --- a/src/AsyncTCP.cpp +++ b/src/AsyncTCP.cpp @@ -1246,7 +1246,9 @@ void AsyncServer::end(){ if(_pcb){ tcp_arg(_pcb, NULL); tcp_accept(_pcb, NULL); - _tcp_abort(_pcb, NULL); + if(tcp_close(_pcb) != ERR_OK){ + _tcp_abort(_pcb, NULL); + } _pcb = NULL; } } From 78a0cba868ceb4ecfce52adda149cbc4f81a2c6d Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Tue, 24 Sep 2019 12:09:18 +0300 Subject: [PATCH 2/2] Update AsyncTCP.cpp --- src/AsyncTCP.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AsyncTCP.cpp b/src/AsyncTCP.cpp index 3c2d589..0805079 100644 --- a/src/AsyncTCP.cpp +++ b/src/AsyncTCP.cpp @@ -1253,7 +1253,7 @@ void AsyncServer::end(){ tcp_arg(_pcb, NULL); tcp_accept(_pcb, NULL); if(tcp_close(_pcb) != ERR_OK){ - _tcp_abort(_pcb, NULL); + _tcp_abort(_pcb); } _pcb = NULL; }