1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Fix for crash in WiFiClientSecure when WiFi is disconnected (#2139)

* WiFiClient: implement stopAll() via stop()

* WiFiClientSecure: clean up ClientContext used by axTLS when stop is called (#2097)
This commit is contained in:
Ivan Grokhotkov
2016-06-13 18:36:30 +08:00
committed by GitHub
parent 6f3785b4b7
commit 43412970ae
2 changed files with 21 additions and 24 deletions

View File

@ -339,24 +339,16 @@ void WiFiClient::_s_err(void* arg, int8_t err)
void WiFiClient::stopAll()
{
for (WiFiClient* it = _s_first; it; it = it->_next) {
ClientContext* c = it->_client;
if (c) {
c->abort();
c->unref();
it->_client = 0;
}
it->stop();
}
}
void WiFiClient::stopAllExcept(WiFiClient * exC) {
void WiFiClient::stopAllExcept(WiFiClient* except)
{
for (WiFiClient* it = _s_first; it; it = it->_next) {
ClientContext* c = it->_client;
if (c && c != exC->_client) {
c->abort();
c->unref();
it->_client = 0;
if (it != except) {
it->stop();
}
}
}