File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1080,6 +1080,8 @@ int HTTPClient::handleHeaderResponse()
1080
1080
return HTTPC_ERROR_NOT_CONNECTED;
1081
1081
}
1082
1082
1083
+ _canReuse = !_useHTTP10;
1084
+
1083
1085
String transferEncoding;
1084
1086
_returnCode = -1 ;
1085
1087
_size = -1 ;
@@ -1098,6 +1100,7 @@ int HTTPClient::handleHeaderResponse()
1098
1100
1099
1101
if (headerLine.startsWith (" HTTP/1." )) {
1100
1102
_returnCode = headerLine.substring (9 , headerLine.indexOf (' ' , 9 )).toInt ();
1103
+ _canReuse = (_returnCode != ' 0' );
1101
1104
} else if (headerLine.indexOf (' :' )) {
1102
1105
String headerName = headerLine.substring (0 , headerLine.indexOf (' :' ));
1103
1106
String headerValue = headerLine.substring (headerLine.indexOf (' :' ) + 1 );
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ class HTTPClient
217
217
String _host;
218
218
uint16_t _port = 0 ;
219
219
int32_t _connectTimeout = -1 ;
220
- bool _reuse = false ;
220
+ bool _reuse = true ;
221
221
uint16_t _tcpTimeout = HTTPCLIENT_DEFAULT_TCP_TIMEOUT;
222
222
bool _useHTTP10 = false ;
223
223
bool _secure = false ;
You can’t perform that action at this time.
0 commit comments