@@ -123,7 +123,7 @@ HTTPClient::HTTPClient()
123
123
HTTPClient::~HTTPClient ()
124
124
{
125
125
if (_client) {
126
- _client-> stop ( );
126
+ DEBUG_HTTPCLIENT ( " [HTTP-Client][~HTTPClient] end() not called before destruction of HTTPClient \n " );
127
127
}
128
128
if (_currentHeaders) {
129
129
delete[] _currentHeaders;
@@ -196,7 +196,7 @@ bool HTTPClient::begin(WiFiClient &client, String host, uint16_t port, String ur
196
196
#ifdef HTTPCLIENT_1_1_COMPATIBLE
197
197
bool HTTPClient::begin (String url, String httpsFingerprint)
198
198
{
199
- if (_client) _canReuse = false ;
199
+ _canReuse = false ;
200
200
end ();
201
201
202
202
_port = 443 ;
@@ -214,7 +214,7 @@ bool HTTPClient::begin(String url, String httpsFingerprint)
214
214
215
215
bool HTTPClient::begin (String url, const uint8_t httpsFingerprint[20 ])
216
216
{
217
- if (_client) _canReuse = false ;
217
+ _canReuse = false ;
218
218
end ();
219
219
220
220
_port = 443 ;
@@ -237,7 +237,7 @@ bool HTTPClient::begin(String url, const uint8_t httpsFingerprint[20])
237
237
*/
238
238
bool HTTPClient::begin (String url)
239
239
{
240
- if (_client) _canReuse = false ;
240
+ _canReuse = false ;
241
241
end ();
242
242
243
243
_port = 80 ;
@@ -299,7 +299,7 @@ bool HTTPClient::beginInternal(String url, const char* expectedProtocol)
299
299
#ifdef HTTPCLIENT_1_1_COMPATIBLE
300
300
bool HTTPClient::begin (String host, uint16_t port, String uri)
301
301
{
302
- if (_client) _canReuse = false ;
302
+ _canReuse = false ;
303
303
end ();
304
304
305
305
clear ();
@@ -325,7 +325,7 @@ bool HTTPClient::begin(String host, uint16_t port, String uri, bool https, Strin
325
325
326
326
bool HTTPClient::begin (String host, uint16_t port, String uri, String httpsFingerprint)
327
327
{
328
- if (_client) _canReuse = false ;
328
+ _canReuse = false ;
329
329
end ();
330
330
331
331
clear ();
@@ -343,7 +343,7 @@ bool HTTPClient::begin(String host, uint16_t port, String uri, String httpsFinge
343
343
344
344
bool HTTPClient::begin (String host, uint16_t port, String uri, const uint8_t httpsFingerprint[20 ])
345
345
{
346
- if (_client) _canReuse = false ;
346
+ _canReuse = false ;
347
347
end ();
348
348
349
349
clear ();
@@ -367,6 +367,7 @@ bool HTTPClient::begin(String host, uint16_t port, String uri, const uint8_t htt
367
367
*/
368
368
void HTTPClient::end (void )
369
369
{
370
+ _canReuse = false ;
370
371
disconnect ();
371
372
clear ();
372
373
}
0 commit comments