Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 90104d2

Browse files
authored
v2.2.0 to fix crash and memory leak
### Releases v2.2.0 1. Fix crash when turn-on debug or start 2. Fix memory leak. Check [Having problemen with AsyncHTTPS memory leak #11](#11) and [Update for memleak in AsyncHTTPSRequest_Impl_Generic.h #13](#13)
1 parent add5847 commit 90104d2

File tree

13 files changed

+304
-319
lines changed

13 files changed

+304
-319
lines changed

changelog.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
## Table of Contents
1212

1313
* [Changelog](#changelog)
14+
* [Releases v2.2.0](#releases-v220)
1415
* [Releases v2.1.3](#releases-v213)
1516
* [Releases v2.1.2](#releases-v212)
1617
* [Releases v2.1.1](#releases-v211)
@@ -31,11 +32,15 @@
3132

3233
## Changelog
3334

35+
### Releases v2.2.0
36+
37+
1. Fix crash when turn-on debug or start
38+
2. Fix memory leak. Check [Having problemen with AsyncHTTPS memory leak #11](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/11) and [Update for memleak in AsyncHTTPSRequest_Impl_Generic.h #13](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/pull/13)
39+
3440
### Releases v2.1.3
3541

3642
1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/12)
3743

38-
3944
### Releases v2.1.2
4045

4146
1. Fix bug

examples/AsyncHTTPSRequest_ESP/AsyncHTTPSRequest_ESP.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
4545
#endif
4646

47-
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPSRequest_Generic v2.1.3"
48-
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN 2001003
47+
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPSRequest_Generic v2.2.0"
48+
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN 2002000
4949

5050
// Level from 0-4
5151
#define ASYNC_HTTPS_DEBUG_PORT Serial
@@ -137,8 +137,8 @@ void requestCB(void *optParm, AsyncHTTPSRequest *request, int readyState)
137137

138138
if (readyState == readyStateDone)
139139
{
140-
AHTTPS_LOGWARN0(F("\n**************************************\n"));
141-
AHTTPS_LOGWARN1(F("Response Code = "), request->responseHTTPString());
140+
AHTTPS_LOGDEBUG0(F("\n**************************************\n"));
141+
AHTTPS_LOGDEBUG1(F("Response Code = "), request->responseHTTPString());
142142

143143
if (request->responseHTTPcode() == 200)
144144
{

examples/AsyncHTTPSRequest_ESP_Multi/AsyncHTTPSRequest_ESP_Multi.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
4545
#endif
4646

47-
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPSRequest_Generic v2.1.3"
48-
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN 2001003
47+
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPSRequest_Generic v2.2.0"
48+
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN 2002000
4949

5050
// Level from 0-4
5151
#define ASYNC_HTTPS_DEBUG_PORT Serial
@@ -181,8 +181,8 @@ void requestCB0(void *optParm, AsyncHTTPSRequest *thisRequest, int readyState)
181181

182182
if (readyState == readyStateDone)
183183
{
184-
AHTTPS_LOGWARN0(F("\n**************************************\n"));
185-
AHTTPS_LOGWARN1(F("Response Code = "), thisRequest->responseHTTPString());
184+
AHTTPS_LOGDEBUG0(F("\n**************************************\n"));
185+
AHTTPS_LOGDEBUG1(F("Response Code = "), thisRequest->responseHTTPString());
186186

187187
if (thisRequest->responseHTTPcode() == 200)
188188
{
@@ -202,8 +202,8 @@ void requestCB1(void *optParm, AsyncHTTPSRequest *thisRequest, int readyState)
202202

203203
if (readyState == readyStateDone)
204204
{
205-
AHTTPS_LOGWARN0(F("\n**************************************\n"));
206-
AHTTPS_LOGWARN1(F("Response Code = "), thisRequest->responseHTTPString());
205+
AHTTPS_LOGDEBUG0(F("\n**************************************\n"));
206+
AHTTPS_LOGDEBUG1(F("Response Code = "), thisRequest->responseHTTPString());
207207

208208
if (thisRequest->responseHTTPcode() == 200)
209209
{

examples/AsyncHTTPSRequest_ESP_WiFiManager/AsyncHTTPSRequest_ESP_WiFiManager.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
4747
#endif
4848

49-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.15.0"
50-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1015000
49+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.15.0"
50+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1015000
5151

52-
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPSRequest_Generic v2.1.3"
53-
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN 2001003
52+
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPSRequest_Generic v2.2.0"
53+
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN 2002000
5454

5555
/////////////////////////////////////////////////////////
5656

examples/AsyncHTTP_HTTPSRequest_ESP/AsyncHTTP_HTTPSRequest_ESP.ino

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@
4444
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
4545
#endif
4646

47-
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPSRequest_Generic v2.1.3"
48-
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN 2001003
47+
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPSRequest_Generic v2.2.0"
48+
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN 2002000
4949

50-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
51-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
50+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
51+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002
5252

5353
// Level from 0-4
5454
#define ASYNC_HTTPS_DEBUG_PORT Serial
5555

5656
#define _ASYNC_TCP_SSL_LOGLEVEL_ 1
57-
#define _ASYNC_HTTPS_LOGLEVEL_ 2
57+
#define _ASYNC_HTTPS_LOGLEVEL_ 1
5858

5959
// 300s = 5 minutes to not flooding
6060
#define HTTPS_REQUEST_INTERVAL 120
@@ -245,8 +245,8 @@ void requestCB0(void *optParm, AsyncHTTPSRequest *thisRequest, int readyState)
245245

246246
if (readyState == readyStateDone)
247247
{
248-
AHTTPS_LOGWARN0(F("\n**************************************\n"));
249-
AHTTPS_LOGWARN1(F("Response Code = "), thisRequest->responseHTTPString());
248+
AHTTPS_LOGDEBUG0(F("\n**************************************\n"));
249+
AHTTPS_LOGDEBUG1(F("Response Code = "), thisRequest->responseHTTPString());
250250

251251
if (thisRequest->responseHTTPcode() == 200)
252252
{
@@ -267,8 +267,8 @@ void requestCB1(void *optParm, AsyncHTTPRequest *thisRequest, int readyState)
267267

268268
if (readyState == readyStateDone)
269269
{
270-
AHTTP_LOGWARN0(F("\n**************************************\n"));
271-
AHTTP_LOGWARN1(F("Response Code = "), thisRequest->responseHTTPString());
270+
AHTTPS_LOGDEBUG0(F("\n**************************************\n"));
271+
AHTTPS_LOGDEBUG1(F("Response Code = "), thisRequest->responseHTTPString());
272272

273273
if (thisRequest->responseHTTPcode() == 200)
274274
{
@@ -289,8 +289,8 @@ void requestCB2(void *optParm, AsyncHTTPRequest *thisRequest, int readyState)
289289

290290
if (readyState == readyStateDone)
291291
{
292-
AHTTP_LOGWARN0(F("\n**************************************\n"));
293-
AHTTP_LOGWARN1(F("Response Code = "), thisRequest->responseHTTPString());
292+
AHTTPS_LOGDEBUG0(F("\n**************************************\n"));
293+
AHTTPS_LOGDEBUG1(F("Response Code = "), thisRequest->responseHTTPString());
294294

295295
if (thisRequest->responseHTTPcode() == 200)
296296
{

examples/WT32_ETH01/AsyncHTTPSRequest_WT32_ETH01/AsyncHTTPSRequest_WT32_ETH01.ino

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@
4444
#error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting.
4545
#endif
4646

47-
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPSRequest_Generic v2.1.3"
48-
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN 2001003
47+
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPSRequest_Generic v2.2.0"
48+
#define ASYNC_HTTPS_REQUEST_GENERIC_VERSION_MIN 2002000
49+
4950
/////////////////////////////////////////////////////////
5051

5152
// Use larger queue size if necessary for large data transfer. Default is 512 bytes if not defined here
@@ -146,8 +147,8 @@ void requestCB(void *optParm, AsyncHTTPSRequest *request, int readyState)
146147

147148
if (readyState == readyStateDone)
148149
{
149-
AHTTPS_LOGWARN0(F("\n**************************************\n"));
150-
AHTTPS_LOGWARN1(F("Response Code = "), request->responseHTTPString());
150+
AHTTPS_LOGDEBUG0(F("\n**************************************\n"));
151+
AHTTPS_LOGDEBUG1(F("Response Code = "), request->responseHTTPString());
151152

152153
if (request->responseHTTPcode() == 200)
153154
{

library.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"AsyncHTTPSRequest_Generic",
3-
"version": "2.1.3",
3+
"version": "2.2.0",
44
"description":"Simple Async HTTPS Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of AsyncTCP_SSL library for ESP32 (including ESP32_S2, ESP32_S3 and ESP32_C3), WT32_ETH01 (ESP32 + LAN8720). Supporting in the future for RP2040W, ESP8266, Portenta_H7, STM32 with built-in LAN8742A Ethernet, etc. Now you can send HTTP / HTTPS requests to multiple addresses and receive responses from them.",
55
"keywords":"communication, async, tcp, https, ssl, tls, ESP8266, ESP32, ESP32-S2, wt32-eth01, ESPAsyncTCP, AsyncTCP, stm32, ethernet, wifi, lan8742a, lan8720, f407ve, nucleo-144, stm32f7",
66
"authors": [
@@ -45,7 +45,7 @@
4545
{
4646
"owner": "khoih-prog",
4747
"name": "AsyncHTTPRequest_Generic",
48-
"version": ">=1.9.1",
48+
"version": ">=1.9.2",
4949
"platforms": ["espressif8266", "espressif32"]
5050
},
5151
{

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=AsyncHTTPSRequest_Generic
2-
version=2.1.3
2+
version=2.2.0
33
author=Bob Lemaire,Khoi Hoang <khoih.prog@gmail.com>
44
maintainer=Khoi Hoang <khoih.prog@gmail.com>
55
license=GPLv3

platformio/platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ lib_ldf_mode = chain+
4848
lib_deps =
4949
; PlatformIO 4.x
5050
; AsyncTCP_SSL@>=1.3.1
51-
; AsyncHTTPRequest_Generic@>=1.9.1
51+
; AsyncHTTPRequest_Generic@>=1.9.2
5252
; WebServer_WT32_ETH01@>=1.5.1
5353
; ESPAsync_WiFiManager@>=1.15.0
5454
; PlatformIO 5.x
5555
khoih-prog/AsyncTCP_SSL@>=1.3.1
56-
khoih-prog/AsyncHTTPRequest_Generic@>=1.9.1
56+
khoih-prog/AsyncHTTPRequest_Generic@>=1.9.2
5757
khoih-prog/WebServer_WT32_ETH01@>=1.5.1
5858
khoih-prog/ESPAsync_WiFiManager@>=1.15.0
5959

src/AsyncHTTPSRequest_Debug_Generic.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
#define _ASYNC_HTTPS_LOGLEVEL_ 0
5959
#endif
6060

61-
/////////////////////////////////////////////////////////
61+
////////////////////////////////////////
6262

6363
const char AHTTPS_MARK[] = "[AHTTPS] ";
6464

@@ -68,39 +68,39 @@ const char AHTTPS_MARK[] = "[AHTTPS] ";
6868
#define AHTTPS_PRINT AHTTPS_DBG_PORT.print
6969
#define AHTTPS_PRINTLN AHTTPS_DBG_PORT.println
7070

71-
/////////////////////////////////////////////////////////
71+
////////////////////////////////////////
7272

7373
#define AHTTPS_LOGERROR(x) if(_ASYNC_HTTPS_LOGLEVEL_>0) { AHTTPS_PRINT_MARK; AHTTPS_PRINTLN(x); }
7474
#define AHTTPS_LOGERROR0(x) if(_ASYNC_HTTPS_LOGLEVEL_>0) { AHTTPS_PRINT(x); }
7575
#define AHTTPS_LOGERROR1(x,y) if(_ASYNC_HTTPS_LOGLEVEL_>0) { AHTTPS_PRINT_MARK; AHTTPS_PRINT(x); AHTTPS_PRINT_SP; AHTTPS_PRINTLN(y); }
7676
#define AHTTPS_LOGERROR2(x,y,z) if(_ASYNC_HTTPS_LOGLEVEL_>0) { AHTTPS_PRINT_MARK; AHTTPS_PRINT(x); AHTTPS_PRINT_SP; AHTTPS_PRINT(y); AHTTPS_PRINT_SP; AHTTPS_PRINTLN(z); }
7777
#define AHTTPS_LOGERROR3(x,y,z,w) if(_ASYNC_HTTPS_LOGLEVEL_>0) { AHTTPS_PRINT_MARK; AHTTPS_PRINT(x); AHTTPS_PRINT_SP; AHTTPS_PRINT(y); AHTTPS_PRINT_SP; AHTTPS_PRINT(z); AHTTPS_PRINT_SP; AHTTPS_PRINTLN(w); }
7878

79-
/////////////////////////////////////////////////////////
79+
////////////////////////////////////////
8080

8181
#define AHTTPS_LOGWARN(x) if(_ASYNC_HTTPS_LOGLEVEL_>1) { AHTTPS_PRINT_MARK; AHTTPS_PRINTLN(x); }
8282
#define AHTTPS_LOGWARN0(x) if(_ASYNC_HTTPS_LOGLEVEL_>1) { AHTTPS_PRINT(x); }
8383
#define AHTTPS_LOGWARN1(x,y) if(_ASYNC_HTTPS_LOGLEVEL_>1) { AHTTPS_PRINT_MARK; AHTTPS_PRINT(x); AHTTPS_PRINT_SP; AHTTPS_PRINTLN(y); }
8484
#define AHTTPS_LOGWARN2(x,y,z) if(_ASYNC_HTTPS_LOGLEVEL_>1) { AHTTPS_PRINT_MARK; AHTTPS_PRINT(x); AHTTPS_PRINT_SP; AHTTPS_PRINT(y); AHTTPS_PRINT_SP; AHTTPS_PRINTLN(z); }
8585
#define AHTTPS_LOGWARN3(x,y,z,w) if(_ASYNC_HTTPS_LOGLEVEL_>1) { AHTTPS_PRINT_MARK; AHTTPS_PRINT(x); AHTTPS_PRINT_SP; AHTTPS_PRINT(y); AHTTPS_PRINT_SP; AHTTPS_PRINT(z); AHTTPS_PRINT_SP; AHTTPS_PRINTLN(w); }
8686

87-
/////////////////////////////////////////////////////////
87+
////////////////////////////////////////
8888

8989
#define AHTTPS_LOGINFO(x) if(_ASYNC_HTTPS_LOGLEVEL_>2) { AHTTPS_PRINT_MARK; AHTTPS_PRINTLN(x); }
9090
#define AHTTPS_LOGINFO0(x) if(_ASYNC_HTTPS_LOGLEVEL_>2) { AHTTPS_PRINT(x); }
9191
#define AHTTPS_LOGINFO1(x,y) if(_ASYNC_HTTPS_LOGLEVEL_>2) { AHTTPS_PRINT_MARK; AHTTPS_PRINT(x); AHTTPS_PRINT_SP; AHTTPS_PRINTLN(y); }
9292
#define AHTTPS_LOGINFO2(x,y,z) if(_ASYNC_HTTPS_LOGLEVEL_>2) { AHTTPS_PRINT_MARK; AHTTPS_PRINT(x); AHTTPS_PRINT_SP; AHTTPS_PRINT(y); AHTTPS_PRINT_SP; AHTTPS_PRINTLN(z); }
9393
#define AHTTPS_LOGINFO3(x,y,z,w) if(_ASYNC_HTTPS_LOGLEVEL_>2) { AHTTPS_PRINT_MARK; AHTTPS_PRINT(x); AHTTPS_PRINT_SP; AHTTPS_PRINT(y); AHTTPS_PRINT_SP; AHTTPS_PRINT(z); AHTTPS_PRINT_SP; AHTTPS_PRINTLN(w); }
9494

95-
/////////////////////////////////////////////////////////
95+
////////////////////////////////////////
9696

9797
#define AHTTPS_LOGDEBUG(x) if(_ASYNC_HTTPS_LOGLEVEL_>3) { AHTTPS_PRINT_MARK; AHTTPS_PRINTLN(x); }
9898
#define AHTTPS_LOGDEBUG0(x) if(_ASYNC_HTTPS_LOGLEVEL_>3) { AHTTPS_PRINT(x); }
9999
#define AHTTPS_LOGDEBUG1(x,y) if(_ASYNC_HTTPS_LOGLEVEL_>3) { AHTTPS_PRINT_MARK; AHTTPS_PRINT(x); AHTTPS_PRINT_SP; AHTTPS_PRINTLN(y); }
100100
#define AHTTPS_LOGDEBUG2(x,y,z) if(_ASYNC_HTTPS_LOGLEVEL_>3) { AHTTPS_PRINT_MARK; AHTTPS_PRINT(x); AHTTPS_PRINT_SP; AHTTPS_PRINT(y); AHTTPS_PRINT_SP; AHTTPS_PRINTLN(z); }
101101
#define AHTTPS_LOGDEBUG3(x,y,z,w) if(_ASYNC_HTTPS_LOGLEVEL_>3) { AHTTPS_PRINT_MARK; AHTTPS_PRINT(x); AHTTPS_PRINT_SP; AHTTPS_PRINT(y); AHTTPS_PRINT_SP; AHTTPS_PRINT(z); AHTTPS_PRINT_SP; AHTTPS_PRINTLN(w); }
102102

103-
/////////////////////////////////////////////////////////
103+
////////////////////////////////////////
104104

105105
#endif // ASYNC_HTTPS_REQUEST_DEBUG_GENERIC_H
106106

0 commit comments

Comments
 (0)