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){
847847void AsyncClient::_error (int8_t err) {
848848 if (_pcb){
849849 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+ }
854856 _pcb = NULL ;
855857 }
856858 if (_error_cb) {
@@ -868,10 +870,12 @@ int8_t AsyncClient::_lwip_fin(tcp_pcb* pcb, int8_t err) {
868870 return ERR_OK;
869871 }
870872 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+ }
875879 if (tcp_close (_pcb) != ERR_OK) {
876880 tcp_abort (_pcb);
877881 }
You can’t perform that action at this time.
0 commit comments