mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-03-29 11:00:39 +00:00
wake up tunnel build queue if a message gets dropped
This commit is contained in:
@@ -275,8 +275,13 @@ namespace tunnel
|
|||||||
|
|
||||||
void TransitTunnels::PostTransitTunnelBuildMsg (std::shared_ptr<I2NPMessage>&& msg)
|
void TransitTunnels::PostTransitTunnelBuildMsg (std::shared_ptr<I2NPMessage>&& msg)
|
||||||
{
|
{
|
||||||
if (msg && m_TunnelBuildMsgQueue.GetSize () < TRANSIT_TUNNELS_BUILD_MSG_QUEUE_MAX_SIZE)
|
if (msg)
|
||||||
m_TunnelBuildMsgQueue.Put (msg);
|
{
|
||||||
|
if (m_TunnelBuildMsgQueue.GetSize () < TRANSIT_TUNNELS_BUILD_MSG_QUEUE_MAX_SIZE)
|
||||||
|
m_TunnelBuildMsgQueue.Put (msg);
|
||||||
|
else
|
||||||
|
m_TunnelBuildMsgQueue.WakeUp (); // tell TBM thread to process queue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransitTunnels::HandleShortTransitTunnelBuildMsg (std::shared_ptr<I2NPMessage>&& msg)
|
void TransitTunnels::HandleShortTransitTunnelBuildMsg (std::shared_ptr<I2NPMessage>&& msg)
|
||||||
@@ -607,7 +612,7 @@ namespace tunnel
|
|||||||
auto tunnel = *it;
|
auto tunnel = *it;
|
||||||
if (ts > tunnel->GetCreationTime () + TUNNEL_EXPIRATION_TIMEOUT ||
|
if (ts > tunnel->GetCreationTime () + TUNNEL_EXPIRATION_TIMEOUT ||
|
||||||
ts + TUNNEL_EXPIRATION_TIMEOUT < tunnel->GetCreationTime () ||
|
ts + TUNNEL_EXPIRATION_TIMEOUT < tunnel->GetCreationTime () ||
|
||||||
(!tunnel->GetNumTransmittedBytes () && ts > tunnel->GetCreationTime () + TUNNEL_EXPIRATION_THRESHOLD)) // inactive?
|
(!tunnel->GetNumTransmittedBytes () && ts > tunnel->GetCreationTime () + 2*TUNNEL_EXPIRATION_THRESHOLD)) // inactive?
|
||||||
{
|
{
|
||||||
LogPrint (eLogDebug, "TransitTunnel: Transit tunnel with id ", tunnel->GetTunnelID (), " expired or inactive");
|
LogPrint (eLogDebug, "TransitTunnel: Transit tunnel with id ", tunnel->GetTunnelID (), " expired or inactive");
|
||||||
tunnels.RemoveTunnel (tunnel->GetTunnelID ());
|
tunnels.RemoveTunnel (tunnel->GetTunnelID ());
|
||||||
|
|||||||
Reference in New Issue
Block a user