Browse Source

log initial destination request

pull/1941/merge
orignal 7 months ago
parent
commit
5ed76b997c
  1. 9
      libi2pd/NetDb.cpp
  2. 6
      libi2pd/NetDbRequests.cpp

9
libi2pd/NetDb.cpp

@ -788,6 +788,8 @@ namespace data @@ -788,6 +788,8 @@ namespace data
direct = false; // floodfill can't be reached directly
if (direct)
{
if (CheckLogLevel (eLogDebug))
LogPrint (eLogDebug, "NetDb: Request ", dest->GetDestination ().ToBase64 (), " at ", floodfill->GetIdentHash ().ToBase64 (), " directly");
auto msg = dest->CreateRequestMessage (floodfill->GetIdentHash ());
msg->onDrop = [this, dest]() { if (dest->IsActive ()) this->m_Requests.SendNextRequest (dest); };
transports.SendMessage (floodfill->GetIdentHash (), msg);
@ -799,6 +801,8 @@ namespace data @@ -799,6 +801,8 @@ namespace data
auto inbound = pool ? pool->GetNextInboundTunnel (nullptr, floodfill->GetCompatibleTransports (true)) : nullptr;
if (outbound && inbound)
{
if (CheckLogLevel (eLogDebug))
LogPrint (eLogDebug, "NetDb: Request ", dest->GetDestination ().ToBase64 (), " at ", floodfill->GetIdentHash ().ToBase64 (), " through tunnels");
auto msg = dest->CreateRequestMessage (floodfill, inbound);
msg->onDrop = [this, dest]() { if (dest->IsActive ()) this->m_Requests.SendNextRequest (dest); };
outbound->SendTunnelDataMsgTo (floodfill->GetIdentHash (), 0,
@ -827,7 +831,8 @@ namespace data @@ -827,7 +831,8 @@ namespace data
LogPrint (eLogWarning, "NetDb: Destination ", destination.ToBase64(), " is requested already");
return;
}
LogPrint(eLogInfo, "NetDb: Destination ", destination.ToBase64(), " being requested directly from ", from.ToBase64());
if (CheckLogLevel (eLogDebug))
LogPrint(eLogDebug, "NetDb: Destination ", destination.ToBase64(), " being requested directly from ", from.ToBase64());
// direct
transports.SendMessage (from, dest->CreateRequestMessage (nullptr, nullptr));
}
@ -1002,7 +1007,7 @@ namespace data @@ -1002,7 +1007,7 @@ namespace data
}
else if (!m_FloodfillBootstrap)
{
LogPrint (eLogWarning, "NetDb: Unsolicited database search reply for ", key);
LogPrint (eLogInfo, "NetDb: Unsolicited or late database search reply for ", key);
return;
}

6
libi2pd/NetDbRequests.cpp

@ -217,7 +217,8 @@ namespace data @@ -217,7 +217,8 @@ namespace data
direct = false; // floodfill can't be reached directly
if (direct)
{
LogPrint (eLogDebug, "NetDbReq: Try ", dest->GetDestination ().ToBase64 (), " at ", count, " floodfill ", nextFloodfill->GetIdentHash ().ToBase64 (), " directly");
if (CheckLogLevel (eLogDebug))
LogPrint (eLogDebug, "NetDbReq: Try ", dest->GetDestination ().ToBase64 (), " at ", count, " floodfill ", nextFloodfill->GetIdentHash ().ToBase64 (), " directly");
auto msg = dest->CreateRequestMessage (nextFloodfill->GetIdentHash ());
msg->onDrop = [this, dest]() { if (dest->IsActive ()) this->SendNextRequest (dest); };
i2p::transport::transports.SendMessage (nextFloodfill->GetIdentHash (), msg);
@ -231,7 +232,8 @@ namespace data @@ -231,7 +232,8 @@ namespace data
auto inbound = pool->GetNextInboundTunnel ();
if (nextFloodfill && outbound && inbound)
{
LogPrint (eLogDebug, "NetDbReq: Try ", dest->GetDestination ().ToBase64 (), " at ", count, " floodfill ", nextFloodfill->GetIdentHash ().ToBase64 (), " through tunnels");
if (CheckLogLevel (eLogDebug))
LogPrint (eLogDebug, "NetDbReq: Try ", dest->GetDestination ().ToBase64 (), " at ", count, " floodfill ", nextFloodfill->GetIdentHash ().ToBase64 (), " through tunnels");
auto msg = dest->CreateRequestMessage (nextFloodfill, inbound);
msg->onDrop = [this, dest]() { if (dest->IsActive ()) this->SendNextRequest (dest); };
outbound->SendTunnelDataMsgTo (nextFloodfill->GetIdentHash (), 0,

Loading…
Cancel
Save