diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-06 18:28:18 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-06 18:28:18 -0700 |
commit | 6807ccd7100e04e637994df37975d30cf6353a50 (patch) | |
tree | 069bd2650e6b3ab2f6bf5cea490bb3d729da5395 | |
parent | 51f46a009a7de20153ff9594a407c55684468a1e (diff) | |
download | infinitytier-6807ccd7100e04e637994df37975d30cf6353a50.tar.gz infinitytier-6807ccd7100e04e637994df37975d30cf6353a50.zip |
Don't need to announce on multicast leave.
-rw-r--r-- | node/Network.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/node/Network.cpp b/node/Network.cpp index fb31f87c..43f3f1fa 100644 --- a/node/Network.cpp +++ b/node/Network.cpp @@ -148,23 +148,14 @@ void Network::multicastSubscribe(const MulticastGroup &mg) void Network::multicastUnsubscribe(const MulticastGroup &mg) { - bool needAnnounce = false; - { - Mutex::Lock _l(_lock); - - std::vector<MulticastGroup> nmg; - for(std::vector<MulticastGroup>::const_iterator i(_myMulticastGroups.begin());i!=_myMulticastGroups.end();++i) { - if (*i != mg) - nmg.push_back(*i); - } - - if (nmg.size() != _myMulticastGroups.size()) { - _myMulticastGroups.swap(nmg); - needAnnounce = true; - } + Mutex::Lock _l(_lock); + std::vector<MulticastGroup> nmg; + for(std::vector<MulticastGroup>::const_iterator i(_myMulticastGroups.begin());i!=_myMulticastGroups.end();++i) { + if (*i != mg) + nmg.push_back(*i); } - if (needAnnounce) - _announceMulticastGroups(); + if (nmg.size() != _myMulticastGroups.size()) + _myMulticastGroups.swap(nmg); } bool Network::applyConfiguration(const SharedPtr<NetworkConfig> &conf) |