Skip to content

Commit

Permalink
clean up faster (fixes espressif#828)
Browse files Browse the repository at this point in the history
flush tcp buffer instead of reading it byte by byte.
  • Loading branch information
h3ndrik committed Feb 6, 2018
1 parent c8596cb commit 1ca5349
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions libraries/HTTPClient/src/HTTPClient.cpp
Expand Up @@ -232,9 +232,7 @@ void HTTPClient::end(void)
if(connected()) {
if(_tcp->available() > 0) {
log_d("still data in buffer (%d), clean up.", _tcp->available());
while(_tcp->available() > 0) {
_tcp->read();
}
_tcp->flush();
}
if(_reuse && _canReuse) {
log_d("tcp keep open for reuse");
Expand Down

0 comments on commit 1ca5349

Please sign in to comment.