Skip to content

Commit 26aec78

Browse files
committed
Version 1.2.2
UPDATE: Utilized stored client internally to avoid dangling pointer issues - Updated begin() overloads to take WiFiSSLClient by reference for simpler usage - Store client internally to avoid dangling pointer issues - Allows calling begin(client, url) directly without &client - Improved safety and maintainability of client handling
1 parent 31dda8f commit 26aec78

File tree

4 files changed

+4
-28
lines changed

4 files changed

+4
-28
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"maintainer": true
1414
}
1515
],
16-
"version": "1.2.1",
16+
"version": "1.2.2",
1717
"frameworks": "arduino",
1818
"platforms": [
1919
"Arduino UNO R4 Boards",

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=R4HttpClient
2-
version=1.2.1
2+
version=1.2.2
33
author=Princetoniño Piscos <[email protected]>
44
maintainer=Princetoniño Piscos <[email protected]>
55
sentence=A lightweight HTTP client wrapper library for Arduino Uno R4 WiFi.

src/R4HttpClient.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,6 @@ R4HttpClient::~R4HttpClient()
1616
this->isDebug = false;
1717
}
1818

19-
/*
20-
* @params: sslClient, url
21-
* @Description: Initializes client, url. Then, extracts the url to get the host, then the endpoint in which where it will do the post request
22-
*/
23-
void R4HttpClient::begin(WiFiSSLClient *sslClient, const String &url)
24-
{
25-
this->client = sslClient;
26-
this->setPort((url.startsWith("https://")) ? 443 : 80);
27-
this->extractUrlComponents(url);
28-
}
29-
30-
/*
31-
* @params: sslClient, url, nport
32-
* @Description: Initializes client, url, port. Then, extracts the url to get the host, then the endpoint in which where it will do the post request
33-
*/
34-
void R4HttpClient::begin(WiFiSSLClient *sslClient, const String &url, const uint16_t &nport)
35-
{
36-
this->client = sslClient;
37-
this->setPort(nport);
38-
this->extractUrlComponents(url);
39-
}
40-
4119
/*
4220
* @params: sslClient, url
4321
* @Description: Initializes client, url. Then, extracts the url to get the host, then the endpoint in which where it will do the post request

src/R4HttpClient.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,8 @@ class R4HttpClient
129129
R4HttpClient();
130130
~R4HttpClient();
131131

132-
void begin(const WiFiSSLClient *sslClient, const String &url);
133-
void begin(const WiFiSSLClient *sslClient, const String &url, const uint16_t &nport);
134-
void begin(const WiFiSSLClient &sslClient, const String &url);
135-
void begin(const WiFiSSLClient &sslClient, const String &url, const uint16_t &nport);
132+
void begin(WiFiSSLClient &sslClient, const String &url);
133+
void begin(WiFiSSLClient &sslClient, const String &url, const uint16_t &nport);
136134

137135
void addHeader(const String &content);
138136
void setTimeout(const int &ms);

0 commit comments

Comments
 (0)