Skip to content

Commit 826c12e

Browse files
committed
Merge branch 'fix-crash-on-fin-v2'
2 parents b171a7b + 13361c8 commit 826c12e

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set(COMPONENT_SRCDIRS
2+
"src"
3+
)
4+
5+
set(COMPONENT_ADD_INCLUDEDIRS
6+
"src"
7+
)
8+
9+
set(COMPONENT_REQUIRES
10+
"arduino-esp32"
11+
)
12+
13+
register_component()
14+
15+
target_compile_options(${COMPONENT_TARGET} PRIVATE -fno-rtti)

src/AsyncTCP.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ typedef struct {
7878

7979
static xQueueHandle _async_queue;
8080
static TaskHandle_t _async_service_task_handle = NULL;
81-
const int _number_of_closed_slots = 16;
81+
const int _number_of_closed_slots = CONFIG_LWIP_MAX_ACTIVE_TCP;
8282
static int _closed_index = 0;
8383
static int _closed_slots[_number_of_closed_slots];
8484

@@ -1278,7 +1278,9 @@ void AsyncServer::end(){
12781278
if(_pcb){
12791279
tcp_arg(_pcb, NULL);
12801280
tcp_accept(_pcb, NULL);
1281-
_tcp_abort(_pcb, -1);
1281+
if(tcp_close(_pcb) != ERR_OK){
1282+
_tcp_abort(_pcb, -1);
1283+
}
12821284
_pcb = NULL;
12831285
}
12841286
}

0 commit comments

Comments
 (0)