Skip to content

Commit 8f21a07

Browse files
committed
Various things can all stop_ssl_socket() which sets the socket to -1; but the WiFiClientSecure checks for _connected. So we want to make sure the latter is always set. And thus have moved the state handling around *ssl_client down into the C code; below WiFiClientSecure.
1 parent 0ac8c9c commit 8f21a07

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Diff for: libraries/WiFiClientSecure/src/WiFiClientSecure.cpp

+5-8
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,12 @@ WiFiClientSecure &WiFiClientSecure::operator=(const WiFiClientSecure &other)
9191

9292
void WiFiClientSecure::stop()
9393
{
94-
if (sslclient->socket >= 0) {
95-
close(sslclient->socket);
96-
sslclient->socket = -1;
97-
_connected = false;
98-
_peek = -1;
99-
_lastReadTimeout = 0;
100-
_lastWriteTimeout = 0;
101-
}
10294
stop_ssl_socket(sslclient, _CA_cert, _cert, _private_key);
95+
96+
_connected = false;
97+
_peek = -1;
98+
_lastReadTimeout = 0;
99+
_lastWriteTimeout = 0;
103100
}
104101

105102
int WiFiClientSecure::connect(IPAddress ip, uint16_t port)

0 commit comments

Comments
 (0)