This commit is contained in:
Mathieu Carbou
2024-10-12 20:55:11 +02:00
parent 665d34ca0b
commit b4a974dc31

View File

@@ -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);
}