File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1080,6 +1080,8 @@ int HTTPClient::handleHeaderResponse()
10801080 return HTTPC_ERROR_NOT_CONNECTED;
10811081 }
10821082
1083+ _canReuse = !_useHTTP10;
1084+
10831085 String transferEncoding;
10841086 _returnCode = -1 ;
10851087 _size = -1 ;
@@ -1098,6 +1100,7 @@ int HTTPClient::handleHeaderResponse()
10981100
10991101 if (headerLine.startsWith (" HTTP/1." )) {
11001102 _returnCode = headerLine.substring (9 , headerLine.indexOf (' ' , 9 )).toInt ();
1103+ _canReuse = (_returnCode != ' 0' );
11011104 } else if (headerLine.indexOf (' :' )) {
11021105 String headerName = headerLine.substring (0 , headerLine.indexOf (' :' ));
11031106 String headerValue = headerLine.substring (headerLine.indexOf (' :' ) + 1 );
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ class HTTPClient
217217 String _host;
218218 uint16_t _port = 0 ;
219219 int32_t _connectTimeout = -1 ;
220- bool _reuse = false ;
220+ bool _reuse = true ;
221221 uint16_t _tcpTimeout = HTTPCLIENT_DEFAULT_TCP_TIMEOUT;
222222 bool _useHTTP10 = false ;
223223 bool _secure = false ;
You can’t perform that action at this time.
0 commit comments