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

Commit 7635f3d

Browse files
authored
v1.0.1
### Releases v1.0.1 1. Restore cpp code besides Impl.h code to use in case of `multiple definition` linker error. Thanks to [Daniel Brunner](https://github.com/0xFEEDC0DE64) to report and make PR in [**Fixed linker errors when included in multiple .cpp files**](#1). See [**HOWTO Fix `Multiple Definitions` Linker Error**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic#HOWTO-Fix-Multiple-Definitions-Linker-Error)
1 parent 79d850e commit 7635f3d

22 files changed

+2138
-47
lines changed

README.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ Chunked responses are recognized and handled transparently.
4545
---
4646
---
4747

48+
### Releases v1.0.1
49+
50+
1. Restore cpp code besides Impl.h code to use in case of `multiple definition` linker error. Thanks to [Daniel Brunner](https://github.com/0xFEEDC0DE64) to report and make PR in [**Fixed linker errors when included in multiple .cpp files**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/pull/1). See [**HOWTO Fix `Multiple Definitions` Linker Error**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic#HOWTO-Fix-Multiple-Definitions-Linker-Error)
51+
52+
4853
### Releases v1.0.0
4954

5055
1. Initial coding to add support to **STM32F/L/H/G/WB/MP1** using built-in LAN8742A Ethernet (Nucleo-144, DISCOVERY, etc).
@@ -212,6 +217,19 @@ theses files must be copied into the corresponding directory:
212217
---
213218
---
214219

220+
### HOWTO Fix `Multiple Definitions` Linker Error
221+
222+
The current library implementation, using xyz-Impl.h instead of standard xyz.cpp, possibly creates certain `Multiple Definitions` Linker error in certain use cases. Although it's simple to just modify several lines of code, either in the library or in the application, the library is adding a separate source directory, named src_cpp, besides the standard src directory.
223+
224+
To use the old standard cpp way, just
225+
226+
1. **Rename the h-only src directory into src_h.**
227+
2. **Then rename the cpp src_cpp directory into src.**
228+
3. Close then reopen the application code in Arduino IDE, etc. to recompile from scratch.
229+
230+
---
231+
---
232+
215233
### Examples
216234

217235
Also see examples:
@@ -442,7 +460,7 @@ AsyncHTTPRequest @ IP : 192.168.2.72
442460
443461
**************************************
444462
abbreviation: EDT
445-
client_ip: 216.154.52.212
463+
client_ip: aaa.bbb.ccc.ddd
446464
datetime: 2020-09-13T18:22:59.555816-04:00
447465
day_of_week: 0
448466
day_of_year: 257
@@ -459,7 +477,7 @@ week_number: 37
459477
460478
**************************************
461479
abbreviation: EDT
462-
client_ip: 216.154.52.212
480+
client_ip: aaa.bbb.ccc.ddd
463481
datetime: 2020-09-13T18:27:57.586325-04:00
464482
day_of_week: 0
465483
day_of_year: 257
@@ -489,7 +507,7 @@ After waiting 3.43 secs more in setup(), connection result is connected. Local I
489507
H
490508
**************************************
491509
abbreviation: EDT
492-
client_ip: 216.154.52.212
510+
client_ip: aaa.bbb.ccc.ddd
493511
datetime: 2020-09-13T19:35:37.951609-04:00
494512
day_of_week: 0
495513
day_of_year: 257
@@ -521,7 +539,7 @@ After waiting 2.35 secs more in setup(), connection result is connected. Local I
521539
H
522540
**************************************
523541
abbreviation: EDT
524-
client_ip: 216.154.52.212
542+
client_ip: aaa.bbb.ccc.ddd
525543
datetime: 2020-09-13T19:37:02.118166-04:00
526544
day_of_week: 0
527545
day_of_year: 257
@@ -539,7 +557,7 @@ week_number: 37
539557
HHHHHHHHH HHHHHHHHHH HHHHHHHHHH H
540558
**************************************
541559
abbreviation: EDT
542-
client_ip: 216.154.52.212
560+
client_ip: aaa.bbb.ccc.ddd
543561
datetime: 2020-09-13T19:42:01.507586-04:00
544562
day_of_week: 0
545563
day_of_year: 257
@@ -570,7 +588,7 @@ HTTP WebServer is @ IP : 192.168.2.81
570588
571589
**************************************
572590
abbreviation: EDT
573-
client_ip: 216.154.52.212
591+
client_ip: aaa.bbb.ccc.ddd
574592
datetime: 2020-09-13T19:56:28.295033-04:00
575593
day_of_week: 0
576594
day_of_year: 257
@@ -690,6 +708,10 @@ Submit issues to: [AsyncHTTPRequest_Generic issues](https://github.com/khoih-pro
690708
---
691709
---
692710

711+
### Releases v1.0.1
712+
713+
1. Restore cpp code besides Impl.h code to use in case of `multiple definition` linker error. Thanks to [Daniel Brunner](https://github.com/0xFEEDC0DE64) to report and make PR in [**Fixed linker errors when included in multiple .cpp files**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/pull/1). See [**HOWTO Fix `Multiple Definitions` Linker Error**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic#HOWTO-Fix-Multiple-Definitions-Linker-Error)
714+
693715
### Releases v1.0.0
694716

695717
1. Initial coding to add support to **STM32F/L/H/G/WB/MP1** using built-in LAN8742A Ethernet (Nucleo-144, DISCOVERY, etc).
@@ -702,13 +724,14 @@ Submit issues to: [AsyncHTTPRequest_Generic issues](https://github.com/khoih-pro
702724

703725
This library is based on, modified, bug-fixed and improved from:
704726

705-
1. [Bob Lemaire's asyncHTTPrequest Library](https://github.com/boblemaire/asyncHTTPrequest)
727+
1. [Bob Lemaire's **asyncHTTPrequest Library**](https://github.com/boblemaire/asyncHTTPrequest) to use the better **asynchronous** features of these following Async TCP Libraries : ( [`ESPAsyncTCP`](https://github.com/me-no-dev/ESPAsyncTCP), [`AsyncTCP`](https://github.com/me-no-dev/AsyncTCP), and [`STM32AsyncTCP`](https://github.com/philbowles/STM32AsyncTCP) ).
706728

707-
to use the better **asynchronous** features of these following Async TCP Libraries : ( [`ESPAsyncTCP`](https://github.com/me-no-dev/ESPAsyncTCP), [`AsyncTCP`](https://github.com/me-no-dev/AsyncTCP), and [`STM32AsyncTCP`](https://github.com/philbowles/STM32AsyncTCP) ).
729+
2. Thanks to [Daniel Brunner](https://github.com/0xFEEDC0DE64) to report and make PR in [Fixed linker errors when included in multiple .cpp files](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/pull/1) leading to v1.0.1. See [**HOWTO Fix `Multiple Definitions` Linker Error**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic#HOWTO-Fix-Multiple-Definitions-Linker-Error)
708730

709731
<table>
710732
<tr>
711733
<td align="center"><a href="https://github.com/boblemaire"><img src="https://github.com/boblemaire.png" width="100px;" alt="boblemaire"/><br /><sub><b>⭐️ Bob Lemaire</b></sub></a><br /></td>
734+
<td align="center"><a href="https://github.com/0xFEEDC0DE64"><img src="https://github.com/0xFEEDC0DE64.png" width="100px;" alt="0xFEEDC0DE64"/><br /><sub><b>Daniel Brunner</b></sub></a><br /></td>
712735
</tr>
713736
</table>
714737

examples/AsyncCustomHeader_STM32/AsyncCustomHeader_STM32.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.0
20+
Version: 1.0.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
25+
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
2526
*****************************************************************************************************************************/
2627

2728
#include "defines.h"

examples/AsyncCustomHeader_STM32/defines.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
2020
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
22-
Version: 1.0.0
22+
Version: 1.0.1
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
2626
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
27+
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
2728
*****************************************************************************************************************************/
2829
/*
2930
Currently support

examples/AsyncDweetGet_STM32/AsyncDweetGet_STM32.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.0
20+
Version: 1.0.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
25+
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
2526
*****************************************************************************************************************************/
2627

2728
/**

examples/AsyncDweetPost_STM32/AsyncDweetPost_STM32.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.0
20+
Version: 1.0.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
25+
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
2526
*****************************************************************************************************************************/
2627

2728
// Dweet.io POST client. Connects to dweet.io once every ten seconds, sends a POST request and a request body.

examples/AsyncHTTPRequest_ESP/AsyncHTTPRequest_ESP.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.0
20+
Version: 1.0.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
25+
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
2526
*****************************************************************************************************************************/
2627
//************************************************************************************************************
2728
//

examples/AsyncHTTPRequest_ESP_WiFiManager/AsyncHTTPRequest_ESP_WiFiManager.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.0
20+
Version: 1.0.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
25+
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
2526
*****************************************************************************************************************************/
2627
//************************************************************************************************************
2728
//

examples/AsyncHTTPRequest_STM32/AsyncHTTPRequest_STM32.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.0
20+
Version: 1.0.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
25+
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
2526
*****************************************************************************************************************************/
2627
//************************************************************************************************************
2728
//

examples/AsyncSimpleGET_STM32/AsyncSimpleGET_STM32.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.0
20+
Version: 1.0.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
25+
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
2526
*****************************************************************************************************************************/
2627

2728
#include "defines.h"

examples/AsyncWebClientRepeating_STM32/AsyncWebClientRepeating_STM32.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.0
20+
Version: 1.0.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
25+
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
2526
*****************************************************************************************************************************/
2627

2728
#include "defines.h"

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"AsyncHTTPRequest_Generic",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description":"Simple Async HTTP Request library, supporting GET and POST, on top of AsyncTCP libraries, such as AsyncTCP, ESPAsyncTCP, AsyncTCP_STM32, etc.. for ESP32, ESP8266 and currently STM32 with built-in LAN8742A Ethernet.",
55
"keywords":"async,tcp,http,ESP8266,ESP32,ESPAsyncTCP,AsyncTCP,stm32,ethernet,wifi,lan8742a",
66
"authors": [

library.properties

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

src/AsyncHTTPRequest_Debug_Generic.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.0
20+
Version: 1.0.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
25+
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
2526
*****************************************************************************************************************************/
26-
27-
#ifndef AsyncHTTPRequest_Debug_STM32_H
28-
#define AsyncHTTPRequest_Debug_STM32_H
27+
28+
#pragma once
2929

3030
#ifdef ASYNC_HTTP_DEBUG_PORT
3131
#define A_DBG_PORT ASYNC_HTTP_DEBUG_PORT
@@ -68,4 +68,3 @@
6868
#define AHTTP_LOGDEBUG2(x,y,z) if(_ASYNC_HTTP_LOGLEVEL_>3) { A_DBG_PORT.print("[AHTTP] "); A_DBG_PORT.print(x); A_DBG_PORT.print(" "); A_DBG_PORT.print(y); A_DBG_PORT.print(" "); A_DBG_PORT.println(z); }
6969
#define AHTTP_LOGDEBUG3(x,y,z,w) if(_ASYNC_HTTP_LOGLEVEL_>3) { A_DBG_PORT.print("[AHTTP] "); A_DBG_PORT.print(x); A_DBG_PORT.print(" "); A_DBG_PORT.print(y); A_DBG_PORT.print(" "); A_DBG_PORT.print(z); A_DBG_PORT.print(" "); A_DBG_PORT.println(w); }
7070

71-
#endif // AsyncHTTPRequest_Debug_STM32_H

src/AsyncHTTPRequest_Generic.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.0
20+
Version: 1.0.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
25+
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
2526
*****************************************************************************************************************************/
26-
27-
#ifndef AsyncHTTPRequest_Generic_h
28-
#define AsyncHTTPRequest_Generic_h
27+
28+
#pragma once
2929

3030
#define AsyncHTTPRequest_Generic_version "1.0.0"
3131

@@ -265,5 +265,3 @@ class AsyncHTTPRequest
265265
};
266266

267267
#include "AsyncHTTPRequest_Impl_Generic.h"
268-
269-
#endif // AsyncHTTPRequest_Generic_h

src/AsyncHTTPRequest_Impl_Generic.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,16 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.0
20+
Version: 1.0.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
25+
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
2526
*****************************************************************************************************************************/
2627

2728
#pragma once
2829

29-
#ifndef AsyncHTTPRequest_Impl_Generic_h
30-
#define AsyncHTTPRequest_Impl_Generic_h
31-
3230

3331
//**************************************************************************************************************
3432
AsyncHTTPRequest::AsyncHTTPRequest(): _readyState(readyStateUnsent), _HTTPcode(0), _chunked(false), _debug(DEBUG_IOTA_HTTP_SET)
@@ -529,6 +527,8 @@ bool AsyncHTTPRequest::_buildRequest()
529527
_request->write(_URL->path);
530528
_request->write(_URL->query);
531529
_request->write(" HTTP/1.1\r\n");
530+
531+
AHTTP_LOGDEBUG3(_HTTPmethod == HTTPmethodGET ? "GET " : "POST ", _URL->path, _URL->query, " HTTP/1.1\r\n" );
532532

533533
delete _URL;
534534

@@ -541,6 +541,9 @@ bool AsyncHTTPRequest::_buildRequest()
541541
_request->write(':');
542542
_request->write(hdr->value);
543543
_request->write("\r\n");
544+
545+
AHTTP_LOGDEBUG3(hdr->name, ":", hdr->value, "\r\n" );
546+
544547
hdr = hdr->next;
545548
}
546549

@@ -1187,5 +1190,3 @@ char* AsyncHTTPRequest::_charstar(const __FlashStringHelper * str)
11871190
}
11881191

11891192
#endif
1190-
1191-
#endif // AsyncHTTPRequest_Impl_Generic_h

src/utility/xbuf.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.0
20+
Version: 1.0.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
25+
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
2526
*****************************************************************************************************************************/
2627

2728
/********************************************************************************************
@@ -44,9 +45,6 @@
4445
********************************************************************************************/
4546
#pragma once
4647

47-
#ifndef xbuf_h
48-
#define xbuf_h
49-
5048
#include <Arduino.h>
5149

5250
struct xseg
@@ -150,4 +148,3 @@ class xbuf: public Print
150148

151149
#include "utility/xbuf_Impl.h"
152150

153-
#endif // xbuf_h

0 commit comments

Comments
 (0)