Skip to content

Commit c51acf2

Browse files
committed
Fix tcp error handler
1 parent e6e57a8 commit c51acf2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

libraries/ESP8266WiFi/src/include/ClientContext.h

+11-2
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,17 @@ class ClientContext {
261261
}
262262

263263
void _error(err_t err) {
264-
DEBUGV(":er %d\r\n", err);
265-
close();
264+
DEBUGV(":er %d %d %d\r\n", err, _size_sent, _send_waiting);
265+
if (err != ERR_ABRT) {
266+
abort();
267+
}
268+
else {
269+
tcp_arg(_pcb, NULL);
270+
tcp_sent(_pcb, NULL);
271+
tcp_recv(_pcb, NULL);
272+
tcp_err(_pcb, NULL);
273+
_pcb = NULL;
274+
}
266275
if(_size_sent && _send_waiting) {
267276
esp_schedule();
268277
}

0 commit comments

Comments
 (0)