|
|
@ -791,19 +791,22 @@ namespace data |
|
|
|
LogPrint (eLogError, "NetDb: Database store msg with reply token is too short ", len, ". Dropped"); |
|
|
|
LogPrint (eLogError, "NetDb: Database store msg with reply token is too short ", len, ". Dropped"); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
auto deliveryStatus = CreateDeliveryStatusMsg (replyToken); |
|
|
|
|
|
|
|
uint32_t tunnelID = bufbe32toh (buf + offset); |
|
|
|
uint32_t tunnelID = bufbe32toh (buf + offset); |
|
|
|
offset += 4; |
|
|
|
offset += 4; |
|
|
|
if (!tunnelID) // send response directly
|
|
|
|
if (replyToken != 0xFFFFFFFFU) // if not caught on OBEP or IBGW
|
|
|
|
transports.SendMessage (buf + offset, deliveryStatus); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
auto pool = i2p::tunnel::tunnels.GetExploratoryPool (); |
|
|
|
auto deliveryStatus = CreateDeliveryStatusMsg (replyToken); |
|
|
|
auto outbound = pool ? pool->GetNextOutboundTunnel () : nullptr; |
|
|
|
if (!tunnelID) // send response directly
|
|
|
|
if (outbound) |
|
|
|
transports.SendMessage (buf + offset, deliveryStatus); |
|
|
|
outbound->SendTunnelDataMsgTo (buf + offset, tunnelID, deliveryStatus); |
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
LogPrint (eLogWarning, "NetDb: No outbound tunnels for DatabaseStore reply found"); |
|
|
|
{ |
|
|
|
|
|
|
|
auto pool = i2p::tunnel::tunnels.GetExploratoryPool (); |
|
|
|
|
|
|
|
auto outbound = pool ? pool->GetNextOutboundTunnel () : nullptr; |
|
|
|
|
|
|
|
if (outbound) |
|
|
|
|
|
|
|
outbound->SendTunnelDataMsgTo (buf + offset, tunnelID, deliveryStatus); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
LogPrint (eLogWarning, "NetDb: No outbound tunnels for DatabaseStore reply found"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
offset += 32; |
|
|
|
offset += 32; |
|
|
|
} |
|
|
|
} |
|
|
|