From 6ec128e8f673864855d12460f47c2c7b8dbde5c0 Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 3 Feb 2026 17:01:52 -0500 Subject: [PATCH] wake up tunnel build queue if a message gets dropped --- libi2pd/TransitTunnel.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libi2pd/TransitTunnel.cpp b/libi2pd/TransitTunnel.cpp index 3c8b9946..e493361c 100644 --- a/libi2pd/TransitTunnel.cpp +++ b/libi2pd/TransitTunnel.cpp @@ -275,8 +275,13 @@ namespace tunnel void TransitTunnels::PostTransitTunnelBuildMsg (std::shared_ptr&& msg) { - if (msg && m_TunnelBuildMsgQueue.GetSize () < TRANSIT_TUNNELS_BUILD_MSG_QUEUE_MAX_SIZE) - m_TunnelBuildMsgQueue.Put (msg); + if (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&& msg) @@ -607,7 +612,7 @@ namespace tunnel auto tunnel = *it; if (ts > tunnel->GetCreationTime () + TUNNEL_EXPIRATION_TIMEOUT || 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"); tunnels.RemoveTunnel (tunnel->GetTunnelID ());