File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -847,10 +847,12 @@ int8_t AsyncClient::_connected(void* pcb, int8_t err){
847
847
void AsyncClient::_error (int8_t err) {
848
848
if (_pcb){
849
849
tcp_arg (_pcb, NULL );
850
- tcp_sent (_pcb, NULL );
851
- tcp_recv (_pcb, NULL );
852
- tcp_err (_pcb, NULL );
853
- tcp_poll (_pcb, NULL , 0 );
850
+ if (_pcb->state == LISTEN) {
851
+ tcp_sent (_pcb, NULL );
852
+ tcp_recv (_pcb, NULL );
853
+ tcp_err (_pcb, NULL );
854
+ tcp_poll (_pcb, NULL , 0 );
855
+ }
854
856
_pcb = NULL ;
855
857
}
856
858
if (_error_cb) {
@@ -868,10 +870,12 @@ int8_t AsyncClient::_lwip_fin(tcp_pcb* pcb, int8_t err) {
868
870
return ERR_OK;
869
871
}
870
872
tcp_arg (_pcb, NULL );
871
- tcp_sent (_pcb, NULL );
872
- tcp_recv (_pcb, NULL );
873
- tcp_err (_pcb, NULL );
874
- tcp_poll (_pcb, NULL , 0 );
873
+ if (_pcb->state == LISTEN) {
874
+ tcp_sent (_pcb, NULL );
875
+ tcp_recv (_pcb, NULL );
876
+ tcp_err (_pcb, NULL );
877
+ tcp_poll (_pcb, NULL , 0 );
878
+ }
875
879
if (tcp_close (_pcb) != ERR_OK) {
876
880
tcp_abort (_pcb);
877
881
}
You can’t perform that action at this time.
0 commit comments