Skip to content

Commit 02a70bb

Browse files
authored
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
1 parent 50e9772 commit 02a70bb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Diff for: libraries/HTTPClient/src/HTTPClient.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,7 @@ void HTTPClient::disconnect(bool preserveClient)
386386
if(connected()) {
387387
if(_client->available() > 0) {
388388
log_d("still data in buffer (%d), clean up.\n", _client->available());
389-
while(_client->available() > 0) {
390-
_client->read();
391-
}
389+
_client->flush();
392390
}
393391

394392
if(_reuse && _canReuse) {

0 commit comments

Comments
 (0)