Skip to content

Commit

Permalink
rename stopAllexcepted to stopAllExcept and simplify the compare
Browse files Browse the repository at this point in the history
  • Loading branch information
Links2004 committed Aug 29, 2015
1 parent 4baac12 commit 301fe53
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
ClientContext* c = it->_client;

if(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) {
if (c && c != exC->_client) {
c->abort();
c->unref();
it->_client = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class WiFiClient : public Client, public SList<WiFiClient> {
using Print::write;

static void stopAll();
static void stopAllexcepted(WiFiClient * c);
static void stopAllExcept(WiFiClient * c);

private:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ t_httpUpdate_return ESP8266HTTPUpdate::update(const char * host, uint16_t port,
} else {

WiFiUDP::stopAll();
WiFiClient::stopAllexcepted(&tcp);
WiFiClient::stopAllExcept(&tcp);

delay(100);

Expand Down

0 comments on commit 301fe53

Please sign in to comment.