Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions src/AsyncTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,16 +656,12 @@ static esp_err_t _tcp_close(tcp_pcb **pcb, AsyncClient *client) {
static err_t _tcp_abort_api(struct tcpip_api_call_data *api_call_msg) {
// Like close(), we must ensure that the queue is cleared
tcp_api_call_t *msg = (tcp_api_call_t *)api_call_msg;
msg->err = ERR_CONN;
if (*msg->pcb) {
tcp_pcb *pcb = *msg->pcb;
_reset_tcp_callbacks(pcb, msg->close);
tcp_abort(pcb);
tcp_abort(*msg->pcb);
*msg->pcb = nullptr; // PCB is now the property of LwIP
msg->err = ERR_OK;
msg->err = ERR_ABRT;
} else {
// Ensure there is not an error event queued for this client
_remove_events_for_client(msg->close);
msg->err = ERR_CONN;
}
return msg->err;
}
Expand Down Expand Up @@ -921,11 +917,8 @@ void AsyncClient::close(bool now) {
}

int8_t AsyncClient::abort() {
if (_pcb) {
_tcp_abort(&_pcb, this);
// _pcb is now NULL
}
return ERR_ABRT;
return _tcp_abort(&_pcb, this);
Copy link

Copilot AI Aug 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return statement is missing proper formatting - it should be indented and the function should have a proper closing brace. The current code appears to have a formatting issue that could cause compilation errors.

Copilot uses AI. Check for mistakes.
// _pcb is now NULL
}

size_t AsyncClient::space() const {
Expand Down