fixed http.end taking too long (#6277)

http end takes 20-30 seconds if there is a large amount of data
replacing this read loop with flush fixes that problem
This commit is contained in:
Yiğit
2022-02-21 11:03:25 +03:00
committed by GitHub
parent 50e9772ecf
commit 02a70bbd21

View File

@ -386,9 +386,7 @@ void HTTPClient::disconnect(bool preserveClient)
if(connected()) {
if(_client->available() > 0) {
log_d("still data in buffer (%d), clean up.\n", _client->available());
while(_client->available() > 0) {
_client->read();
}
_client->flush();
}
if(_reuse && _canReuse) {