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

Commit

Permalink
v2.7.0 to fix bugs
Browse files Browse the repository at this point in the history
### Releases v2.7.0

1. Fix wrong `reqStates` bug. Check [Callback behavior buggy #19](khoih-prog/AsyncHTTPSRequest_Generic#19)
2. Fix `_parseURL()` bug. Check [Bug with _parseURL() #21](khoih-prog/AsyncHTTPSRequest_Generic#21)
3. Improve `README.md` so that links can be used in other sites, such as `PIO`
  • Loading branch information
khoih-prog committed Feb 1, 2023
1 parent d3b0362 commit 59238ae
Show file tree
Hide file tree
Showing 17 changed files with 88 additions and 51 deletions.
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ However, before reporting a bug please check through the following:

If you don't find anything, please [open a new issue](https://github.com/khoih-prog/AsyncHTTPSRequest_ESP32_Ethernet/issues/new).

---

### How to submit a bug report

Please ensure to specify the following:
Expand All @@ -35,7 +37,7 @@ Arduino IDE version: 1.8.19
ESP32S3_DEV board
ESP32 core v2.0.6
OS: Ubuntu 20.04 LTS
Linux xy-Inspiron-3593 5.15.0-57-generic #63~20.04.1-Ubuntu SMP Wed Nov 30 13:40:16 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Linux xy-Inspiron-3593 5.15.0-58-generic #64~20.04.1-Ubuntu SMP Fri Jan 6 16:42:31 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Context:
I encountered a crash while using this library
Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
## Table of Contents

* [Changelog](#changelog)
* [Releases v2.7.0](#releases-v270)
* [Releases v2.6.0](#releases-v260)
* [Releases v2.5.0](#releases-v250)
* [Releases v2.4.0](#releases-v240)
Expand All @@ -26,6 +27,12 @@

## Changelog

### Releases v2.7.0

1. Fix wrong `reqStates` bug. Check [Callback behavior buggy #19](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/19)
2. Fix `_parseURL()` bug. Check [Bug with _parseURL() #21](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/21)
3. Improve `README.md` so that links can be used in other sites, such as `PIO`

### Releases v2.6.0

1. Add support to `ESP32` and `ESP32S2/S3/C3` boards using `LwIP W6100 Ethernet`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
#error This AsyncHTTPSRequest_ESP32_Ethernet library is currently supporting only ESP32 using LwIP Ethernet
#endif

#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.4.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2004000
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.7.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2007000

/////////////////////////////////////////////////////////

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
#error This AsyncHTTPSRequest_ESP32_Ethernet library is currently supporting only ESP32 using LwIP Ethernet
#endif

#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.5.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2005000
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.7.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2007000

/////////////////////////////////////////////////////////

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
#error This AsyncHTTPSRequest_ESP32_Ethernet library is currently supporting only ESP32 using LwIP Ethernet
#endif

#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.5.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2005000
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.7.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2007000

/////////////////////////////////////////////////////////

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
#error This AsyncHTTPSRequest_ESP32_Ethernet library is currently supporting only ESP32 using LwIP Ethernet
#endif

#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.5.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2005000
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.7.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2007000

/////////////////////////////////////////////////////////

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
#error This AsyncHTTPSRequest_ESP32_Ethernet library is currently supporting only ESP32 using LwIP Ethernet
#endif

#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.4.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2004000
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.7.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2007000

/////////////////////////////////////////////////////////

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
#error This AsyncHTTPSRequest_ESP32_Ethernet library is currently supporting only ESP32 using LwIP Ethernet
#endif

#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.6.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2006000
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.7.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2007000

/////////////////////////////////////////////////////////

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
#error This AsyncHTTPSRequest_ESP32_Ethernet library is currently supporting only ESP32 using LwIP Ethernet
#endif

#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.4.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2004000
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.7.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2007000

/////////////////////////////////////////////////////////

Expand Down
4 changes: 2 additions & 2 deletions examples/multiFileProject/multiFileProject.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting.
#endif

#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.4.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2004000
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN_TARGET "AsyncHTTPSRequest_ESP32_Ethernet v2.7.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MIN 2007000

/////////////////////////////////////////////////////////

Expand Down
10 changes: 5 additions & 5 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"AsyncHTTPSRequest_ESP32_Ethernet",
"version": "2.6.0",
"version": "2.7.0",
"description":"Simple Async HTTPS Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of AsyncTCP_SSL library for ESP32/S2/S3/C3, WT32_ETH01 (ESP32 + LAN8720), ESP32 using LwIP ENC28J60, W5500, W6100 or LAN8720",
"keywords":"communication, async, tcp, http, https, ssl, tls, esp32, esp32-s2, esp32-s3, esp32-c3, wt32-eth01, ethernet, w5500, w6100, enc28j60, lan8720, lwip, lwip-ethernet, lwip-enc28j60, lwip-w5500, lwip-w6100, lwip-lan8720",
"authors": [
Expand Down Expand Up @@ -51,19 +51,19 @@
{
"owner": "khoih-prog",
"name": "WebServer_ESP32_ENC",
"version": ">=1.5.1",
"version": ">=1.5.3",
"platforms": ["espressif32"]
},
{
"owner": "khoih-prog",
"name": "WebServer_ESP32_SC_ENC",
"version": ">=1.2.0",
"version": ">=1.2.1",
"platforms": ["espressif32"]
},
{
"owner": "khoih-prog",
"name": "WebServer_ESP32_W5500",
"version": ">=1.5.2",
"version": ">=1.5.3",
"platforms": ["espressif32"]
},
{
Expand All @@ -75,7 +75,7 @@
{
"owner": "khoih-prog",
"name": "WebServer_ESP32_W6100",
"version": ">=1.5.2",
"version": ">=1.5.3",
"platforms": ["espressif32"]
},
{
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=AsyncHTTPSRequest_ESP32_Ethernet
version=2.6.0
version=2.7.0
author=Bob Lemaire,Khoi Hoang <khoih.prog@gmail.com>
maintainer=Khoi Hoang <khoih.prog@gmail.com>
license=GPLv3
Expand Down
32 changes: 17 additions & 15 deletions platformio/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,29 @@ upload_speed = 921600
; ============================================================
; Checks for the compatibility with frameworks and dev/platforms
lib_compat_mode = strict
lib_ldf_mode = chain+
;lib_ldf_mode = chain+
;lib_ldf_mode = deep+

; ============================================================
lib_deps =
; PlatformIO 4.x
; AsyncTCP_SSL@>=1.3.1
; WebServer_WT32_ETH01@>=1.5.1
; WebServer_ESP32_ENC@>=1.5.1
; WebServer_ESP32_SC_ENC@>=1.2.0
; WebServer_ESP32_W5500@>=1.5.2
; WebServer_ESP32_ENC@>=1.5.3
; WebServer_ESP32_SC_ENC@>=1.2.1
; WebServer_ESP32_W5500@>=1.5.3
; WebServer_ESP32_SC_W5500@>=1.2.1
; WebServer_ESP32_W6100@>=1.5.2
; WebServer_ESP32_W6100@>=1.5.3
; WebServer_ESP32_SC_W6100@>=1.2.1

; PlatformIO 5.x
khoih-prog/AsyncTCP_SSL@>=1.3.1
khoih-prog/WebServer_WT32_ETH01@>=1.5.1
khoih-prog/WebServer_ESP32_ENC@>=1.5.1
khoih-prog/WebServer_ESP32_SC_ENC@>=1.2.0
khoih-prog/WebServer_ESP32_W5500@>=1.5.2
khoih-prog/WebServer_ESP32_ENC@>=1.5.3
khoih-prog/WebServer_ESP32_SC_ENC@>=1.2.1
khoih-prog/WebServer_ESP32_W5500@>=1.5.3
khoih-prog/WebServer_ESP32_SC_W5500@>=1.2.1
khoih-prog/WebServer_ESP32_W6100@>=1.5.2
khoih-prog/WebServer_ESP32_W6100@>=1.5.3
khoih-prog/WebServer_ESP32_SC_W6100@>=1.2.1

; ============================================================
Expand Down Expand Up @@ -118,7 +118,7 @@ platform_packages =
toolchain-xtensa32s2@file://C:\Users\Max\Downloads\xtensa-esp32s2-elf
framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git#a4118ea88987c28aac3a49bcb9cc5d6c0acc6f3f
platformio/tool-esptoolpy @ ~1.30100
framework = arduino
board = esp32dev
board_build.mcu = esp32s2
board_build.partitions = huge_app.csv
Expand All @@ -134,12 +134,13 @@ build_flags =
-DARDUINO_ESP32S2_DEV
-DARDUINO_VARIANT="esp32s2"


; ============================================================
; ============================================================
[env:esp32s3]
platform = espressif32
framework = arduino

board = esp32-s3-devkitc-1
board_build.mcu = esp32s3
board_build.partitions = huge_app.csv
board_build.variant = esp32s3
Expand All @@ -154,12 +155,13 @@ build_flags =
-DARDUINO_ESP32S3_DEV
-DARDUINO_VARIANT="esp32s3"


; ============================================================
[env:esp32c3]
; ============================================================
[env:esp32sc3]
platform = espressif32
framework = arduino

board = esp32-c3-devkitm-1
board_build.mcu = esp32c3
board_build.partitions = huge_app.csv
board_build.variant = esp32c3
Expand All @@ -174,5 +176,5 @@ build_flags =
-DARDUINO_ESP32S3_DEV
-DARDUINO_VARIANT="esp32c3"


; ============================================================
; ============================================================
; ============================================================
4 changes: 3 additions & 1 deletion src/AsyncHTTPSRequest_ESP32_Ethernet.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
You should have received a copy of the GNU General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>.
Version: 2.5.0
Version: 2.7.0
Version Modified By Date Comments
------- ----------- ---------- -----------
2.4.0 K Hoang 16/12/2022 Initial coding to port to ESP32S3 boards using LwIP W5500 or ENC28J60 Ethernet
2.5.0 K Hoang 21/12/2022 Add support to ESP32S2/C3 boards using LwIP W5500 or ENC28J60 Ethernet
2.6.0 K Hoang 09/01/2023 Add support to `ESP32` and `ESP32S2/S3/C3` boards using `LwIP W6100 Ethernet`
2.7.0 K Hoang 01/02/2023 Fix wrong reqStates and `_parseURL()` bugs
*****************************************************************************************************************************/

#pragma once
Expand Down
14 changes: 9 additions & 5 deletions src/AsyncHTTPSRequest_ESP32_Ethernet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
You should have received a copy of the GNU General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>.
Version: 2.5.0
Version: 2.7.0
Version Modified By Date Comments
------- ----------- ---------- -----------
2.4.0 K Hoang 16/12/2022 Initial coding to port to ESP32S3 boards using LwIP W5500 or ENC28J60 Ethernet
2.5.0 K Hoang 21/12/2022 Add support to ESP32S2/C3 boards using LwIP W5500 or ENC28J60 Ethernet
2.6.0 K Hoang 09/01/2023 Add support to `ESP32` and `ESP32S2/S3/C3` boards using `LwIP W6100 Ethernet`
2.7.0 K Hoang 01/02/2023 Fix wrong reqStates and `_parseURL()` bugs
*****************************************************************************************************************************/

#pragma once
Expand All @@ -39,13 +41,13 @@

////////////////////////////////////////

#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION "AsyncHTTPSRequest_ESP32_Ethernet v2.5.0"
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION "AsyncHTTPSRequest_ESP32_Ethernet v2.7.0"

#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MAJOR 2
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MINOR 5
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_MINOR 7
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_PATCH 0

#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_INT 2005000
#define ASYNC_HTTPS_REQUEST_ESP32_ETHERNET_VERSION_INT 2007000

////////////////////////////////////////

Expand Down Expand Up @@ -224,7 +226,9 @@ class xbuf: public Print

////////////////////////////////////////

#define DEFAULT_RX_TIMEOUT 30 // Seconds for timeout
#if !defined(DEFAULT_RX_TIMEOUT)
#define DEFAULT_RX_TIMEOUT 30 // Seconds for timeout
#endif

////////////////////////////////////////

Expand Down
4 changes: 3 additions & 1 deletion src/AsyncHTTPSRequest_ESP32_Ethernet_Debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
You should have received a copy of the GNU General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>.
Version: 2.5.0
Version: 2.7.0
Version Modified By Date Comments
------- ----------- ---------- -----------
2.4.0 K Hoang 16/12/2022 Initial coding to port to ESP32S3 boards using LwIP W5500 or ENC28J60 Ethernet
2.5.0 K Hoang 21/12/2022 Add support to ESP32S2/C3 boards using LwIP W5500 or ENC28J60 Ethernet
2.6.0 K Hoang 09/01/2023 Add support to `ESP32` and `ESP32S2/S3/C3` boards using `LwIP W6100 Ethernet`
2.7.0 K Hoang 01/02/2023 Fix wrong reqStates and `_parseURL()` bugs
*****************************************************************************************************************************/

#pragma once
Expand Down
30 changes: 24 additions & 6 deletions src/AsyncHTTPSRequest_ESP32_Ethernet_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
You should have received a copy of the GNU General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>.
Version: 2.5.0
Version: 2.7.0
Version Modified By Date Comments
------- ----------- ---------- -----------
2.4.0 K Hoang 16/12/2022 Initial coding to port to ESP32S3 boards using LwIP W5500 or ENC28J60 Ethernet
2.5.0 K Hoang 21/12/2022 Add support to ESP32S2/C3 boards using LwIP W5500 or ENC28J60 Ethernet
2.6.0 K Hoang 09/01/2023 Add support to `ESP32` and `ESP32S2/S3/C3` boards using `LwIP W6100 Ethernet`
2.7.0 K Hoang 01/02/2023 Fix wrong reqStates and `_parseURL()` bugs
*****************************************************************************************************************************/

#pragma once
Expand Down Expand Up @@ -1221,11 +1223,28 @@ bool AsyncHTTPSRequest::_parseURL(const String& url)

int pathBeg = url.indexOf('/', hostBeg);

int hostEnd;
int portBeg;

if (pathBeg < 0)
return false;
{
if ( url.indexOf(':', hostBeg) < 0 )
{
// No port, just https://www.aaa.com
hostEnd = url.length();
}
else
{
// with port, https://www.aaa.com:443
hostEnd = url.indexOf(':', hostBeg);
}
}
else
{
hostEnd = pathBeg;
}

int hostEnd = pathBeg;
int portBeg = url.indexOf(':', hostBeg);
portBeg = url.indexOf(':', hostBeg);

if (portBeg > 0 && portBeg < pathBeg)
{
Expand Down Expand Up @@ -1386,8 +1405,7 @@ size_t AsyncHTTPSRequest::_send()
if ( ! _client->connected())
{
// KH fix bug https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/38
_HTTPcode = HTTPCODE_NOT_CONNECTED;
_setReadyState(readyStateUnsent);
_timeout = DEFAULT_RX_TIMEOUT;
///////////////////////////

return 0;
Expand Down

0 comments on commit 59238ae

Please sign in to comment.