Commit 7d782470 authored by Jeroen88's avatar Jeroen88 Committed by Me No Dev

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

parent 89feacb8
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment