shutdown and graceful shutdown through I2PControl

This commit is contained in:
orignal 2015-01-09 22:27:52 -05:00
parent 70b6c024bf
commit 912146b1c9
4 changed files with 64 additions and 6 deletions

View file

@ -610,5 +610,18 @@ namespace tunnel
i2p::context.GetSharedRouterInfo ()
}));
}
int Tunnels::GetTransitTunnelsExpirationTimeout ()
{
int timeout = 0;
uint32_t ts = i2p::util::GetSecondsSinceEpoch ();
std::unique_lock<std::mutex> l(m_TransitTunnelsMutex);
for (auto it: m_TransitTunnels)
{
int t = it.second->GetCreationTime () + TUNNEL_EXPIRATION_TIMEOUT - ts;
if (t > timeout) timeout = t;
}
return timeout;
}
}
}