Skip to content

Commit c6000b2

Browse files
committed
Merge remote-tracking branch 'arduino/master' into rp2040
2 parents 3832dae + 51acbd9 commit c6000b2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

arduino/libraries/WiFi/src/WiFiClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ int WiFiClient::peek()
150150
{
151151
uint8_t b;
152152

153-
if (recv(_socket, &b, sizeof(b), MSG_PEEK | MSG_DONTWAIT) <= 0) {
153+
if (lwip_recv_r(_socket, &b, sizeof(b), MSG_PEEK | MSG_DONTWAIT) <= 0) {
154154
if (errno != EWOULDBLOCK) {
155155
lwip_close_r(_socket);
156156
_socket = -1;
@@ -177,7 +177,7 @@ void WiFiClient::stop()
177177
uint8_t WiFiClient::connected()
178178
{
179179
if (_socket != -1) {
180-
available();
180+
peek();
181181
}
182182

183183
return (_socket != -1);

main/CommandHandler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ WiFiUDP udps[MAX_SOCKETS];
4747
WiFiSSLClient tlsClients[MAX_SOCKETS];
4848
WiFiServer tcpServers[MAX_SOCKETS];
4949

50-
BearSSLClient bearsslClient(tcpClients[0], ArduinoIoTCloudTrustAnchor, ArduinoIoTCloudTrustAnchor_NUM);
50+
WiFiClient bearssl_tcp_client;
51+
BearSSLClient bearsslClient(bearssl_tcp_client, ArduinoIoTCloudTrustAnchor, ArduinoIoTCloudTrustAnchor_NUM);
5152

5253
int setNet(const uint8_t command[], uint8_t response[])
5354
{
@@ -664,7 +665,6 @@ int startClientTcp(const uint8_t command[], uint8_t response[])
664665
} else if (type == 0x04) {
665666
int result;
666667

667-
bearsslClient.setClient(tcpClients[socket]);
668668
configureECCx08();
669669

670670
if (host[0] != '\0') {

0 commit comments

Comments
 (0)