mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 20:13:44 +02:00
Put multicast txQueue back to list.
This commit is contained in:
parent
221df51875
commit
3f71afd0fb
2 changed files with 12 additions and 18 deletions
|
@ -275,12 +275,10 @@ void Multicaster::clean(uint64_t now)
|
||||||
{
|
{
|
||||||
Mutex::Lock _l(_groups_m);
|
Mutex::Lock _l(_groups_m);
|
||||||
for(std::map< std::pair<uint64_t,MulticastGroup>,MulticastGroupStatus >::iterator mm(_groups.begin());mm!=_groups.end();) {
|
for(std::map< std::pair<uint64_t,MulticastGroup>,MulticastGroupStatus >::iterator mm(_groups.begin());mm!=_groups.end();) {
|
||||||
for(std::vector<OutboundMulticast>::iterator tx(mm->second.txQueue.begin());tx!=mm->second.txQueue.end();) {
|
for(std::list<OutboundMulticast>::iterator tx(mm->second.txQueue.begin());tx!=mm->second.txQueue.end();) {
|
||||||
if ((tx->expired(now))||(tx->atLimit())) {
|
if ((tx->expired(now))||(tx->atLimit()))
|
||||||
// erase element (replace by last)
|
mm->second.txQueue.erase(tx++);
|
||||||
*tx = mm->second.txQueue.back();
|
else ++tx;
|
||||||
mm->second.txQueue.pop_back();
|
|
||||||
} else ++tx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long count = 0;
|
unsigned long count = 0;
|
||||||
|
@ -328,18 +326,14 @@ void Multicaster::_add(uint64_t now,uint64_t nwid,const MulticastGroup &mg,Multi
|
||||||
|
|
||||||
//TRACE("..MC %s joined multicast group %.16llx/%s via %s",member.toString().c_str(),nwid,mg.toString().c_str(),((learnedFrom) ? learnedFrom.toString().c_str() : "(direct)"));
|
//TRACE("..MC %s joined multicast group %.16llx/%s via %s",member.toString().c_str(),nwid,mg.toString().c_str(),((learnedFrom) ? learnedFrom.toString().c_str() : "(direct)"));
|
||||||
|
|
||||||
for(std::vector<OutboundMulticast>::iterator tx(gs.txQueue.begin());tx!=gs.txQueue.end();) {
|
for(std::list<OutboundMulticast>::iterator tx(gs.txQueue.begin());tx!=gs.txQueue.end();) {
|
||||||
if (tx->atLimit()) {
|
if (tx->atLimit())
|
||||||
// erase element (replace by last)
|
gs.txQueue.erase(tx++);
|
||||||
*tx = gs.txQueue.back();
|
else {
|
||||||
gs.txQueue.pop_back();
|
|
||||||
} else {
|
|
||||||
tx->sendIfNew(RR,member);
|
tx->sendIfNew(RR,member);
|
||||||
if (tx->atLimit()) {
|
if (tx->atLimit())
|
||||||
// erase element (replace by last)
|
gs.txQueue.erase(tx++);
|
||||||
*tx = gs.txQueue.back();
|
else ++tx;
|
||||||
gs.txQueue.pop_back();
|
|
||||||
} else ++tx;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ private:
|
||||||
MulticastGroupStatus() : lastExplicitGather(0) {}
|
MulticastGroupStatus() : lastExplicitGather(0) {}
|
||||||
|
|
||||||
uint64_t lastExplicitGather;
|
uint64_t lastExplicitGather;
|
||||||
std::vector<OutboundMulticast> txQueue; // pending outbound multicasts
|
std::list<OutboundMulticast> txQueue; // pending outbound multicasts
|
||||||
std::vector<MulticastGroupMember> members; // members of this group
|
std::vector<MulticastGroupMember> members; // members of this group
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue