Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit 4b20e84

Browse files
committed
abort and close are called without client in the server code
1 parent 4e7d1c3 commit 4b20e84

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/AsyncTCP.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ static esp_err_t _tcp_recved(tcp_pcb * pcb, size_t len, AsyncClient * client) {
420420
static err_t _tcp_close_api(struct tcpip_api_call_data *api_call_msg){
421421
tcp_api_call_t * msg = (tcp_api_call_t *)api_call_msg;
422422
msg->err = 0;
423-
if(msg->client && msg->client->pcb()){
423+
if(!msg->client || msg->client->pcb()){
424424
msg->err = tcp_close(msg->pcb);
425425
}
426426
return msg->err;
@@ -441,7 +441,7 @@ static esp_err_t _tcp_close(tcp_pcb * pcb, AsyncClient * client) {
441441
static err_t _tcp_abort_api(struct tcpip_api_call_data *api_call_msg){
442442
tcp_api_call_t * msg = (tcp_api_call_t *)api_call_msg;
443443
msg->err = 0;
444-
if(msg->client && msg->client->pcb()){
444+
if(!msg->client || msg->client->pcb()){
445445
tcp_abort(msg->pcb);
446446
}
447447
return msg->err;

0 commit comments

Comments
 (0)