mirror of
https://github.com/me-no-dev/AsyncTCP.git
synced 2025-08-04 05:04:42 +02:00
Fix #27: Required to lock TCPIP core functionality
This commit is contained in:
@@ -951,6 +951,7 @@ int8_t AsyncClient::_connected(tcp_pcb* pcb, int8_t err){
|
|||||||
|
|
||||||
void AsyncClient::_error(int8_t err) {
|
void AsyncClient::_error(int8_t err) {
|
||||||
if(_pcb){
|
if(_pcb){
|
||||||
|
TCP_MUTEX_LOCK();
|
||||||
tcp_arg(_pcb, NULL);
|
tcp_arg(_pcb, NULL);
|
||||||
if(_pcb->state == LISTEN) {
|
if(_pcb->state == LISTEN) {
|
||||||
tcp_sent(_pcb, NULL);
|
tcp_sent(_pcb, NULL);
|
||||||
@@ -958,6 +959,7 @@ void AsyncClient::_error(int8_t err) {
|
|||||||
tcp_err(_pcb, NULL);
|
tcp_err(_pcb, NULL);
|
||||||
tcp_poll(_pcb, NULL, 0);
|
tcp_poll(_pcb, NULL, 0);
|
||||||
}
|
}
|
||||||
|
TCP_MUTEX_UNLOCK();
|
||||||
_free_closed_slot();
|
_free_closed_slot();
|
||||||
_pcb = NULL;
|
_pcb = NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user