Browse Source

Cleanup m_sessions.

cl-refactor
chriseth 10 years ago
parent
commit
bf63f32a5e
  1. 11
      libp2p/Host.cpp

11
libp2p/Host.cpp

@ -742,9 +742,14 @@ void Host::keepAlivePeers()
return;
RecursiveGuard l(x_sessions);
for (auto p: m_sessions)
if (auto pp = p.second.lock())
pp->ping();
for (auto it = m_sessions.begin(); it != m_sessions.end();)
if (auto p = it->second.lock())
{
p->ping();
++it;
}
else
it = m_sessions.erase(it);
m_lastPing = chrono::steady_clock::now();
}

Loading…
Cancel
Save