me-no-dev / ESPAsyncTCP

Async TCP Library for ESP8266
GNU Lesser General Public License v3.0
758 stars 394 forks source link

the close(true) causes issues #141

Closed Synodiporos closed 4 years ago

Synodiporos commented 4 years ago

Hi all, I am facing the following issue when sending a http request (I am using the ESPAsyncTCP as an http client to post a large file on a server). The request is send by using the send() method after adding a fragment of 536 bytes of the request to the buffer using the add(data, length) method. Under some circumstances the close(true) method is called to cancel the http request. After this the http client is not working as expected. The client is able to connect() and canSend() packets but no acknowledgements are received and the process is stuck. In short, if a packet have been send and then close() the connection before the ack is received, the above issue appears.

To overcome the issue i added the following lines into the _close() function on line 513 (ESPAsyncTCP.cpp) but i am not sure if this affects other parts of the functionality.

_tx_unacked_len  = 0;
_tx_acked_len  = 0;
_pcb_busy = false;

Could you please advise me?

stale[bot] commented 4 years ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.