It builds... almost ready to test some rules engine stuff.
This commit is contained in:
parent
8007ca56aa
commit
00fd9c3a15
14 changed files with 121 additions and 154 deletions
|
@ -74,34 +74,6 @@ Topology::Topology(const RuntimeEnvironment *renv) :
|
|||
|
||||
Topology::~Topology()
|
||||
{
|
||||
Buffer<ZT_PEER_SUGGESTED_SERIALIZATION_BUFFER_SIZE> *pbuf = 0;
|
||||
try {
|
||||
pbuf = new Buffer<ZT_PEER_SUGGESTED_SERIALIZATION_BUFFER_SIZE>();
|
||||
std::string all;
|
||||
|
||||
Address *a = (Address *)0;
|
||||
SharedPtr<Peer> *p = (SharedPtr<Peer> *)0;
|
||||
Hashtable< Address,SharedPtr<Peer> >::Iterator i(_peers);
|
||||
while (i.next(a,p)) {
|
||||
if (std::find(_rootAddresses.begin(),_rootAddresses.end(),*a) == _rootAddresses.end()) {
|
||||
pbuf->clear();
|
||||
try {
|
||||
(*p)->serialize(*pbuf);
|
||||
try {
|
||||
all.append((const char *)pbuf->data(),pbuf->size());
|
||||
} catch ( ... ) {
|
||||
return; // out of memory? just skip
|
||||
}
|
||||
} catch ( ... ) {} // peer too big? shouldn't happen, but it so skip
|
||||
}
|
||||
}
|
||||
|
||||
RR->node->dataStorePut("peers.save",all,true);
|
||||
|
||||
delete pbuf;
|
||||
} catch ( ... ) {
|
||||
delete pbuf;
|
||||
}
|
||||
}
|
||||
|
||||
SharedPtr<Peer> Topology::addPeer(const SharedPtr<Peer> &peer)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue