Skip to content

Commit

Permalink
Add logs for pcb was closed before reaching LwIP task
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieucarbou committed Feb 8, 2025
1 parent 43cb8bb commit d558f88
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/AsyncTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,8 @@ static err_t _tcp_output_api(struct tcpip_api_call_data *api_call_msg) {
msg->err = ERR_CONN;
if (msg->closed_slot == INVALID_CLOSED_SLOT || !_closed_slots[msg->closed_slot]) {
msg->err = tcp_output(msg->pcb);
} else {
log_e("pcb was closed before reaching LwIP task");
}
return msg->err;
}
Expand All @@ -566,6 +568,8 @@ static err_t _tcp_write_api(struct tcpip_api_call_data *api_call_msg) {
msg->err = ERR_CONN;
if (msg->closed_slot == INVALID_CLOSED_SLOT || !_closed_slots[msg->closed_slot]) {
msg->err = tcp_write(msg->pcb, msg->write.data, msg->write.size, msg->write.apiflags);
} else {
log_e("pcb was closed before reaching LwIP task");
}
return msg->err;
}
Expand All @@ -592,6 +596,8 @@ static err_t _tcp_recved_api(struct tcpip_api_call_data *api_call_msg) {
// if(msg->closed_slot != INVALID_CLOSED_SLOT) {
msg->err = 0;
tcp_recved(msg->pcb, msg->received);
} else {
log_e("pcb was closed before reaching LwIP task");
}
return msg->err;
}
Expand All @@ -613,6 +619,8 @@ static err_t _tcp_close_api(struct tcpip_api_call_data *api_call_msg) {
msg->err = ERR_CONN;
if (msg->closed_slot == INVALID_CLOSED_SLOT || !_closed_slots[msg->closed_slot]) {
msg->err = tcp_close(msg->pcb);
} else {
log_e("pcb was closed before reaching LwIP task");
}
return msg->err;
}
Expand All @@ -633,6 +641,8 @@ static err_t _tcp_abort_api(struct tcpip_api_call_data *api_call_msg) {
msg->err = ERR_CONN;
if (msg->closed_slot == INVALID_CLOSED_SLOT || !_closed_slots[msg->closed_slot]) {
tcp_abort(msg->pcb);
} else {
log_e("pcb was closed before reaching LwIP task");
}
return msg->err;
}
Expand Down

0 comments on commit d558f88

Please sign in to comment.