clean up faster (fixes #828) (#1087)

flush tcp buffer instead of reading it byte by byte.
This commit is contained in:
h3ndrik 2018-03-04 20:53:04 +01:00 committed by Me No Dev
parent 494ff217aa
commit e3a5ae439b

View File

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