From 29661a630854e89b0d551f3ca699792e9ddb5f9e Mon Sep 17 00:00:00 2001 From: tantive Date: Thu, 3 Jan 2019 20:40:57 +0100 Subject: [PATCH] Fixed "Guru Meditation Error: Core 1 panic'ed (LoadProhibited) . Exception was unhandled." (see https://github.com/espressif/esp-idf/issues/1467) --- src/AsyncTCP.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/AsyncTCP.cpp b/src/AsyncTCP.cpp index e604095..f06cccc 100644 --- a/src/AsyncTCP.cpp +++ b/src/AsyncTCP.cpp @@ -281,7 +281,11 @@ typedef struct { static err_t _tcp_output_api(struct tcpip_api_call_data *api_call_msg){ tcp_api_call_t * msg = (tcp_api_call_t *)api_call_msg; - msg->err = tcp_output(msg->pcb); + if(msg->pcb){ + msg->err = tcp_output(msg->pcb); + } else { + msg->err = 0; + } return msg->err; } @@ -1161,9 +1165,9 @@ void AsyncServer::end(){ tcp_arg(_pcb, NULL); tcp_accept(_pcb, NULL); if(_in_lwip_thread){ - tcp_abort(_pcb); + tcp_close(_pcb); } else { - _tcp_abort(_pcb); + _tcp_close(_pcb); } _pcb = NULL; }