mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-21 16:49:10 +01:00
try to send lookup reply directly to IBGW
This commit is contained in:
parent
e85e96bc35
commit
2dbf094433
1 changed files with 17 additions and 5 deletions
|
@ -1114,12 +1114,24 @@ namespace data
|
||||||
else
|
else
|
||||||
LogPrint(eLogWarning, "NetDb: Encrypted reply requested but no tags provided");
|
LogPrint(eLogWarning, "NetDb: Encrypted reply requested but no tags provided");
|
||||||
}
|
}
|
||||||
auto exploratoryPool = i2p::tunnel::tunnels.GetExploratoryPool ();
|
bool direct = true;
|
||||||
auto outbound = exploratoryPool ? exploratoryPool->GetNextOutboundTunnel () : nullptr;
|
if (!i2p::transport::transports.IsConnected (ident))
|
||||||
if (outbound)
|
{
|
||||||
outbound->SendTunnelDataMsgTo (replyIdent, replyTunnelID, replyMsg);
|
auto r = FindRouter (replyIdent);
|
||||||
else
|
if (r && !r->IsReachableFrom (i2p::context.GetRouterInfo ()))
|
||||||
|
direct = false;
|
||||||
|
}
|
||||||
|
if (direct)
|
||||||
transports.SendMessage (replyIdent, i2p::CreateTunnelGatewayMsg (replyTunnelID, replyMsg));
|
transports.SendMessage (replyIdent, i2p::CreateTunnelGatewayMsg (replyTunnelID, replyMsg));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto exploratoryPool = i2p::tunnel::tunnels.GetExploratoryPool ();
|
||||||
|
auto outbound = exploratoryPool ? exploratoryPool->GetNextOutboundTunnel () : nullptr;
|
||||||
|
if (outbound)
|
||||||
|
outbound->SendTunnelDataMsgTo (replyIdent, replyTunnelID, replyMsg);
|
||||||
|
else
|
||||||
|
LogPrint (eLogWarning, "NetDb: Can't send lookup reply to ", replyIdent.ToBase64 (), ". Non reachable and no outbound tunnels");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
transports.SendMessage (replyIdent, replyMsg);
|
transports.SendMessage (replyIdent, replyMsg);
|
||||||
|
|
Loading…
Add table
Reference in a new issue