From b4a974dc31dc632721adc72a588f7bf839716935 Mon Sep 17 00:00:00 2001 From: Mathieu Carbou Date: Sat, 12 Oct 2024 20:55:11 +0200 Subject: [PATCH] Fix #26 --- src/AsyncTCP.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/AsyncTCP.cpp b/src/AsyncTCP.cpp index 76282d6..cedf006 100644 --- a/src/AsyncTCP.cpp +++ b/src/AsyncTCP.cpp @@ -447,7 +447,17 @@ static esp_err_t _tcp_write(tcp_pcb * pcb, int8_t closed_slot, const char* data, static err_t _tcp_recved_api(struct tcpip_api_call_data *api_call_msg){ tcp_api_call_t * msg = (tcp_api_call_t *)api_call_msg; msg->err = ERR_CONN; - if(msg->closed_slot == INVALID_CLOSED_SLOT || !_closed_slots[msg->closed_slot]) { + // original code: + // if(msg->closed_slot == INVALID_CLOSED_SLOT || !_closed_slots[msg->closed_slot]) { + + // attempted fix which was rolled back since non reproductible after middleware support in ESPAsyncWebServer: + // - https://github.com/mathieucarbou/AsyncTCP/pull/24 + // if(msg->closed_slot != INVALID_CLOSED_SLOT && !_closed_slots[msg->closed_slot]) { + + // final fix based on: + // - OpenDTU testing: https://github.com/tbnobody/OpenDTU/discussions/2326 + // - Original fix https://github.com/me-no-dev/AsyncTCP/pull/173/files#diff-5312944d5b5f39741f3827dd678a8e828e2624ceab236264c025ef2bdf400d6aR422-R428 + if(msg->closed_slot != INVALID_CLOSED_SLOT) { msg->err = 0; tcp_recved(msg->pcb, msg->received); }