Skip to content

Commit e263013

Browse files
committed
Add logs for pcb was closed before reaching LwIP task
1 parent 72af1cf commit e263013

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/AsyncTCP.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,8 @@ static err_t _tcp_output_api(struct tcpip_api_call_data *api_call_msg) {
546546
msg->err = ERR_CONN;
547547
if (msg->closed_slot == INVALID_CLOSED_SLOT || !_closed_slots[msg->closed_slot]) {
548548
msg->err = tcp_output(msg->pcb);
549+
} else {
550+
log_e("pcb was closed before reaching LwIP task");
549551
}
550552
return msg->err;
551553
}
@@ -566,6 +568,8 @@ static err_t _tcp_write_api(struct tcpip_api_call_data *api_call_msg) {
566568
msg->err = ERR_CONN;
567569
if (msg->closed_slot == INVALID_CLOSED_SLOT || !_closed_slots[msg->closed_slot]) {
568570
msg->err = tcp_write(msg->pcb, msg->write.data, msg->write.size, msg->write.apiflags);
571+
} else {
572+
log_e("pcb was closed before reaching LwIP task");
569573
}
570574
return msg->err;
571575
}
@@ -592,6 +596,8 @@ static err_t _tcp_recved_api(struct tcpip_api_call_data *api_call_msg) {
592596
// if(msg->closed_slot != INVALID_CLOSED_SLOT) {
593597
msg->err = 0;
594598
tcp_recved(msg->pcb, msg->received);
599+
} else {
600+
log_e("pcb was closed before reaching LwIP task");
595601
}
596602
return msg->err;
597603
}
@@ -613,6 +619,8 @@ static err_t _tcp_close_api(struct tcpip_api_call_data *api_call_msg) {
613619
msg->err = ERR_CONN;
614620
if (msg->closed_slot == INVALID_CLOSED_SLOT || !_closed_slots[msg->closed_slot]) {
615621
msg->err = tcp_close(msg->pcb);
622+
} else {
623+
log_e("pcb was closed before reaching LwIP task");
616624
}
617625
return msg->err;
618626
}
@@ -633,6 +641,8 @@ static err_t _tcp_abort_api(struct tcpip_api_call_data *api_call_msg) {
633641
msg->err = ERR_CONN;
634642
if (msg->closed_slot == INVALID_CLOSED_SLOT || !_closed_slots[msg->closed_slot]) {
635643
tcp_abort(msg->pcb);
644+
} else {
645+
log_e("pcb was closed before reaching LwIP task");
636646
}
637647
return msg->err;
638648
}

0 commit comments

Comments
 (0)