Fix: (1) Windows stack overflow due to buffer too large in peer deserialize, (2) clean up some other stuff seen during debugging and reduce the sizes of some buffers due to Windows small stack size, (3) remove a redundant try/catch.

This commit is contained in:
Adam Ierymenko 2015-11-13 12:14:28 -08:00
parent 90f9415107
commit 0d9f33dc4f
12 changed files with 103 additions and 97 deletions

View file

@ -200,9 +200,21 @@ public:
void clean(uint64_t now);
/**
* @param now Current time
* @return Number of peers with active direct paths
*/
unsigned long countActive() const;
inline unsigned long countActive(uint64_t now) const
{
unsigned long cnt = 0;
Mutex::Lock _l(_lock);
Hashtable< Address,SharedPtr<Peer> >::Iterator i(const_cast<Topology *>(this)->_peers);
Address *a = (Address *)0;
SharedPtr<Peer> *p = (SharedPtr<Peer> *)0;
while (i.next(a,p)) {
cnt += (unsigned long)((*p)->hasActiveDirectPath(now));
}
return cnt;
}
/**
* Apply a function or function object to all peers
@ -253,7 +265,7 @@ private:
Identity _getIdentity(const Address &zta);
void _setWorld(const World &newWorld);
const RuntimeEnvironment *RR;
const RuntimeEnvironment *const RR;
World _world;
Hashtable< Address,SharedPtr<Peer> > _peers;