Skip to content

Commit d5401af

Browse files
Merge pull request #106 from willmmiles/proper-fin
Defer close on fin to async task
2 parents 9757c79 + 4865282 commit d5401af

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/AsyncTCP.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,6 @@ int8_t AsyncTCP_detail::tcp_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *pb
468468
e->event = LWIP_TCP_FIN;
469469
e->fin.pcb = pcb;
470470
e->fin.err = err;
471-
// close the PCB in LwIP thread
472-
client->_lwip_fin(e->fin.pcb, e->fin.err);
473471
}
474472

475473
queue_mutex_guard guard;
@@ -1043,9 +1041,7 @@ int8_t AsyncClient::_lwip_fin(tcp_pcb *pcb, int8_t err) {
10431041

10441042
// In Async Thread
10451043
int8_t AsyncClient::_fin(tcp_pcb *pcb, int8_t err) {
1046-
if (_discard_cb) {
1047-
_discard_cb(_discard_cb_arg, this);
1048-
}
1044+
close();
10491045
return ERR_OK;
10501046
}
10511047

0 commit comments

Comments
 (0)