1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

rename stopAllexcepted to stopAllExcept and simplify the compare

This commit is contained in:
Markus Sattler 2015-08-29 15:33:41 +02:00
parent a3bc0e924b
commit 966bf45b35
3 changed files with 4 additions and 15 deletions

View File

@ -302,22 +302,11 @@ void WiFiClient::stopAll()
} }
void WiFiClient::stopAllexcepted(WiFiClient * exC) { void WiFiClient::stopAllExcept(WiFiClient * exC) {
for (WiFiClient* it = _s_first; it; it = it->_next) { for (WiFiClient* it = _s_first; it; it = it->_next) {
ClientContext* c = it->_client; ClientContext* c = it->_client;
if(c && exC->_client) { if (c && c != exC->_client) {
if(exC->_client->getRemoteAddress() == c->getRemoteAddress()) {
if(exC->_client->getRemotePort() == c->getRemotePort()) {
if(exC->_client->getLocalPort() == c->getLocalPort()) {
// ignore this
c = NULL;
}
}
}
}
if (c) {
c->abort(); c->abort();
c->unref(); c->unref();
it->_client = 0; it->_client = 0;

View File

@ -93,7 +93,7 @@ public:
using Print::write; using Print::write;
static void stopAll(); static void stopAll();
static void stopAllexcepted(WiFiClient * c); static void stopAllExcept(WiFiClient * c);
private: private:

View File

@ -130,7 +130,7 @@ t_httpUpdate_return ESP8266HTTPUpdate::update(const char * host, uint16_t port,
} else { } else {
WiFiUDP::stopAll(); WiFiUDP::stopAll();
WiFiClient::stopAllexcepted(&tcp); WiFiClient::stopAllExcept(&tcp);
delay(100); delay(100);