Skip to content

Commit 3a10f93

Browse files
author
Jeroen88
committed
Removed _client->stop() from destructor; some minor changes
1 parent a1e59e9 commit 3a10f93

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp

+8-7
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ HTTPClient::HTTPClient()
123123
HTTPClient::~HTTPClient()
124124
{
125125
if(_client) {
126-
_client->stop();
126+
DEBUG_HTTPCLIENT("[HTTP-Client][~HTTPClient] end() not called before destruction of HTTPClient\n");
127127
}
128128
if(_currentHeaders) {
129129
delete[] _currentHeaders;
@@ -196,7 +196,7 @@ bool HTTPClient::begin(WiFiClient &client, String host, uint16_t port, String ur
196196
#ifdef HTTPCLIENT_1_1_COMPATIBLE
197197
bool HTTPClient::begin(String url, String httpsFingerprint)
198198
{
199-
if(_client) _canReuse = false;
199+
_canReuse = false;
200200
end();
201201

202202
_port = 443;
@@ -214,7 +214,7 @@ bool HTTPClient::begin(String url, String httpsFingerprint)
214214

215215
bool HTTPClient::begin(String url, const uint8_t httpsFingerprint[20])
216216
{
217-
if(_client) _canReuse = false;
217+
_canReuse = false;
218218
end();
219219

220220
_port = 443;
@@ -237,7 +237,7 @@ bool HTTPClient::begin(String url, const uint8_t httpsFingerprint[20])
237237
*/
238238
bool HTTPClient::begin(String url)
239239
{
240-
if(_client) _canReuse = false;
240+
_canReuse = false;
241241
end();
242242

243243
_port = 80;
@@ -299,7 +299,7 @@ bool HTTPClient::beginInternal(String url, const char* expectedProtocol)
299299
#ifdef HTTPCLIENT_1_1_COMPATIBLE
300300
bool HTTPClient::begin(String host, uint16_t port, String uri)
301301
{
302-
if(_client) _canReuse = false;
302+
_canReuse = false;
303303
end();
304304

305305
clear();
@@ -325,7 +325,7 @@ bool HTTPClient::begin(String host, uint16_t port, String uri, bool https, Strin
325325

326326
bool HTTPClient::begin(String host, uint16_t port, String uri, String httpsFingerprint)
327327
{
328-
if(_client) _canReuse = false;
328+
_canReuse = false;
329329
end();
330330

331331
clear();
@@ -343,7 +343,7 @@ bool HTTPClient::begin(String host, uint16_t port, String uri, String httpsFinge
343343

344344
bool HTTPClient::begin(String host, uint16_t port, String uri, const uint8_t httpsFingerprint[20])
345345
{
346-
if(_client) _canReuse = false;
346+
_canReuse = false;
347347
end();
348348

349349
clear();
@@ -367,6 +367,7 @@ bool HTTPClient::begin(String host, uint16_t port, String uri, const uint8_t htt
367367
*/
368368
void HTTPClient::end(void)
369369
{
370+
_canReuse = false;
370371
disconnect();
371372
clear();
372373
}

0 commit comments

Comments
 (0)