Skip to content

Commit 54bfbf3

Browse files
committed
Upadte comments and Readme.
1 parent ce575f0 commit 54bfbf3

File tree

9 files changed

+29
-8
lines changed

9 files changed

+29
-8
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ The SPI Ethernet module that uses WIZNet W5100, W5500 and ENC28J60 are supported
103103
// by not set any buffer size or set the rx buffer size to maximum SSL record size (16384) and 512 for tx buffer size.
104104
ssl_client.setBufferSizes(1024 /* rx */, 512 /* tx */);
105105

106-
// assign the basic client
106+
// Assign the basic client
107+
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
108+
// as long as it was used by ssl_client for transportation.
107109
ssl_client.setClient(&basic_client);
108110

109111
Serial.print("Connecting to server...");
@@ -182,6 +184,8 @@ param **`client`** The pointer to Client interface.
182184

183185
param **`enableSSL`** The ssl option; true for enable, false for disable.
184186

187+
Due to the client pointer is assigned, to avoid dangling pointer, basic_client should be existed as long as it was used by ssl_client for transportation.
188+
185189
```cpp
186190
void setClient(Client *client, bool enableSSL = true);
187191
```

examples/certificate/certificate.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ void setup()
141141
*/
142142
ssl_client.setDebugLevel(1);
143143

144-
// assign the basic client
144+
// Assign the basic client
145+
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
146+
// as long as it was used by ssl_client for transportation.
145147
ssl_client.setClient(&basic_client);
146148
}
147149

examples/ethernet/ethernet.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ void setup()
9090
*/
9191
ssl_client.setDebugLevel(1);
9292

93-
// assign the basic client
93+
// Assign the basic client
94+
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
95+
// as long as it was used by ssl_client for transportation.
9496
ssl_client.setClient(&basic_client);
9597
}
9698

examples/gsm/gsm.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ void loop()
210210
*/
211211
ssl_client.setDebugLevel(1);
212212

213-
// assign the basic client
213+
// Assign the basic client
214+
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
215+
// as long as it was used by ssl_client for transportation.
214216
ssl_client.setClient(&basic_client);
215217

216218
Serial.println("---------------------------------");

examples/http_upgrade/http_upgrade.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ void setup()
8181
*/
8282
ssl_client.setDebugLevel(1);
8383

84-
// assign the basic client
84+
// Assign the basic client
85+
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
86+
// as long as it was used by ssl_client for transportation.
8587
ssl_client.setClient(&basic_client, false /* set enable SSL option to false */);
8688
}
8789

examples/https/https.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ void setup()
8282
*/
8383
ssl_client.setDebugLevel(1);
8484

85-
// assign the basic client
85+
// Assign the basic client
86+
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
87+
// as long as it was used by ssl_client for transportation.
8688
ssl_client.setClient(&basic_client);
8789
}
8890

examples/mqtt/mqtt.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ void setup()
9999
*/
100100
ssl_client.setDebugLevel(1);
101101

102-
// assign the basic client
102+
// Assign the basic client
103+
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
104+
// as long as it was used by ssl_client for transportation.
103105
ssl_client.setClient(&basic_client);
104106

105107
Serial.print("Attempting to connect to the MQTT broker over ssl: ");

examples/session/session.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ void setup()
202202
*/
203203
ssl_client.setDebugLevel(1);
204204

205-
// assign the basic client
205+
// Assign the basic client
206+
// Due to the basic_client pointer is assigned, to avoid dangling pointer, basic_client should be existed
207+
// as long as it was used by ssl_client for transportation.
206208
ssl_client.setClient(&basic_client);
207209
}
208210

src/client/BSSL_TCP_Client.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ class BSSL_TCP_Client : public Client
7878
* Set the client.
7979
* @param client The pointer to Client interface.
8080
* @param enableSSL The ssl option; true for enable, false for disable.
81+
*
82+
* Due to the client pointer is assigned, to avoid dangling pointer,
83+
* basic_client should be existed as long as it was used by ssl_client for transportation.
8184
*/
8285
void setClient(Client *client, bool enableSSL = true);
8386

0 commit comments

Comments
 (0)