Fix persistance issue found, see ESP8266 issue #6152 (#2851)

This commit is contained in:
Jeroen88 2019-06-05 14:00:00 +02:00 committed by Me No Dev
parent 89feacb813
commit 7d7824701f
2 changed files with 4 additions and 1 deletions

View File

@ -1080,6 +1080,8 @@ int HTTPClient::handleHeaderResponse()
return HTTPC_ERROR_NOT_CONNECTED;
}
_canReuse = !_useHTTP10;
String transferEncoding;
_returnCode = -1;
_size = -1;
@ -1098,6 +1100,7 @@ int HTTPClient::handleHeaderResponse()
if(headerLine.startsWith("HTTP/1.")) {
_returnCode = headerLine.substring(9, headerLine.indexOf(' ', 9)).toInt();
_canReuse = (_returnCode != '0');
} else if(headerLine.indexOf(':')) {
String headerName = headerLine.substring(0, headerLine.indexOf(':'));
String headerValue = headerLine.substring(headerLine.indexOf(':') + 1);

View File

@ -217,7 +217,7 @@ protected:
String _host;
uint16_t _port = 0;
int32_t _connectTimeout = -1;
bool _reuse = false;
bool _reuse = true;
uint16_t _tcpTimeout = HTTPCLIENT_DEFAULT_TCP_TIMEOUT;
bool _useHTTP10 = false;
bool _secure = false;