mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-22 21:23:07 +03:00
Merge branch 'master' into patch-2
This commit is contained in:
commit
b2a92963d3
@ -193,6 +193,12 @@ void HTTPClient::begin(String host, uint16_t port, String url, bool https, Strin
|
|||||||
*/
|
*/
|
||||||
void HTTPClient::end(void) {
|
void HTTPClient::end(void) {
|
||||||
if(connected()) {
|
if(connected()) {
|
||||||
|
if(_tcp->available() > 0) {
|
||||||
|
DEBUG_HTTPCLIENT("[HTTP-Client][end] still data in buffer (%d), clean up.\n", _tcp->available());
|
||||||
|
while(_tcp->available() > 0) {
|
||||||
|
_tcp->read();
|
||||||
|
}
|
||||||
|
}
|
||||||
if(_reuse && _canReuse) {
|
if(_reuse && _canReuse) {
|
||||||
DEBUG_HTTPCLIENT("[HTTP-Client][end] tcp keep open for reuse\n");
|
DEBUG_HTTPCLIENT("[HTTP-Client][end] tcp keep open for reuse\n");
|
||||||
} else {
|
} else {
|
||||||
@ -711,6 +717,9 @@ bool HTTPClient::connect(void) {
|
|||||||
|
|
||||||
if(connected()) {
|
if(connected()) {
|
||||||
DEBUG_HTTPCLIENT("[HTTP-Client] connect. already connected, try reuse!\n");
|
DEBUG_HTTPCLIENT("[HTTP-Client] connect. already connected, try reuse!\n");
|
||||||
|
while(_tcp->available() > 0) {
|
||||||
|
_tcp->read();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user