@@ -128,11 +128,11 @@ static inline bool _init_async_event_queue() {
128
128
return true ;
129
129
}
130
130
131
- static inline bool _send_async_event (lwip_tcp_event_packet_t **e, TickType_t wait = portMAX_DELAY ) {
131
+ static inline bool _send_async_event (lwip_tcp_event_packet_t **e, TickType_t wait = 0 ) {
132
132
return _async_queue && xQueueSend (_async_queue, e, wait ) == pdPASS;
133
133
}
134
134
135
- static inline bool _prepend_async_event (lwip_tcp_event_packet_t **e, TickType_t wait = portMAX_DELAY ) {
135
+ static inline bool _prepend_async_event (lwip_tcp_event_packet_t **e, TickType_t wait = 0 ) {
136
136
return _async_queue && xQueueSendToFront (_async_queue, e, wait ) == pdPASS;
137
137
}
138
138
@@ -376,6 +376,7 @@ static int8_t _tcp_connected(void *arg, tcp_pcb *pcb, int8_t err) {
376
376
if (!_prepend_async_event (&e)) {
377
377
free ((void *)(e));
378
378
log_e (" Failed to queue event: LWIP_TCP_CONNECTED" );
379
+ tcp_abort (pcb);
379
380
return ERR_TIMEOUT;
380
381
}
381
382
return ERR_OK;
@@ -402,6 +403,7 @@ static int8_t _tcp_poll(void *arg, struct tcp_pcb *pcb) {
402
403
if (!_send_async_event (&e, 0 )) {
403
404
free ((void *)(e));
404
405
log_e (" Failed to queue event: LWIP_TCP_POLL" );
406
+ tcp_abort (pcb);
405
407
return ERR_TIMEOUT;
406
408
}
407
409
return ERR_OK;
@@ -431,6 +433,7 @@ static int8_t _tcp_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *pb, int8_t
431
433
if (!_send_async_event (&e)) {
432
434
free ((void *)(e));
433
435
log_e (" Failed to queue event: LWIP_TCP_RECV or LWIP_TCP_FIN" );
436
+ tcp_abort (pcb);
434
437
return ERR_TIMEOUT;
435
438
}
436
439
return ERR_OK;
@@ -450,6 +453,7 @@ static int8_t _tcp_sent(void *arg, struct tcp_pcb *pcb, uint16_t len) {
450
453
if (!_send_async_event (&e)) {
451
454
free ((void *)(e));
452
455
log_e (" Failed to queue event: LWIP_TCP_SENT" );
456
+ tcp_abort (pcb);
453
457
return ERR_TIMEOUT;
454
458
}
455
459
return ERR_OK;
@@ -505,6 +509,7 @@ static int8_t _tcp_accept(void *arg, AsyncClient *client) {
505
509
if (!_prepend_async_event (&e)) {
506
510
free ((void *)(e));
507
511
log_e (" Failed to queue event: LWIP_TCP_ACCEPT" );
512
+ client->abort ();
508
513
return ERR_TIMEOUT;
509
514
}
510
515
return ERR_OK;
0 commit comments