Browse Source

log initial destination request

pull/1941/merge
orignal 8 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
direct = false; // floodfill can't be reached directly direct = false; // floodfill can't be reached directly
if (direct) if (direct)
{ {
if (CheckLogLevel (eLogDebug))
LogPrint (eLogDebug, "NetDb: Request ", dest->GetDestination ().ToBase64 (), " at ", floodfill->GetIdentHash ().ToBase64 (), " directly");
auto msg = dest->CreateRequestMessage (floodfill->GetIdentHash ()); auto msg = dest->CreateRequestMessage (floodfill->GetIdentHash ());
msg->onDrop = [this, dest]() { if (dest->IsActive ()) this->m_Requests.SendNextRequest (dest); }; msg->onDrop = [this, dest]() { if (dest->IsActive ()) this->m_Requests.SendNextRequest (dest); };
transports.SendMessage (floodfill->GetIdentHash (), msg); transports.SendMessage (floodfill->GetIdentHash (), msg);
@ -799,6 +801,8 @@ namespace data
auto inbound = pool ? pool->GetNextInboundTunnel (nullptr, floodfill->GetCompatibleTransports (true)) : nullptr; auto inbound = pool ? pool->GetNextInboundTunnel (nullptr, floodfill->GetCompatibleTransports (true)) : nullptr;
if (outbound && inbound) 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); auto msg = dest->CreateRequestMessage (floodfill, inbound);
msg->onDrop = [this, dest]() { if (dest->IsActive ()) this->m_Requests.SendNextRequest (dest); }; msg->onDrop = [this, dest]() { if (dest->IsActive ()) this->m_Requests.SendNextRequest (dest); };
outbound->SendTunnelDataMsgTo (floodfill->GetIdentHash (), 0, outbound->SendTunnelDataMsgTo (floodfill->GetIdentHash (), 0,
@ -827,7 +831,8 @@ namespace data
LogPrint (eLogWarning, "NetDb: Destination ", destination.ToBase64(), " is requested already"); LogPrint (eLogWarning, "NetDb: Destination ", destination.ToBase64(), " is requested already");
return; 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 // direct
transports.SendMessage (from, dest->CreateRequestMessage (nullptr, nullptr)); transports.SendMessage (from, dest->CreateRequestMessage (nullptr, nullptr));
} }
@ -1002,7 +1007,7 @@ namespace data
} }
else if (!m_FloodfillBootstrap) 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; return;
} }

6
libi2pd/NetDbRequests.cpp

@ -217,7 +217,8 @@ namespace data
direct = false; // floodfill can't be reached directly direct = false; // floodfill can't be reached directly
if (direct) 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 ()); auto msg = dest->CreateRequestMessage (nextFloodfill->GetIdentHash ());
msg->onDrop = [this, dest]() { if (dest->IsActive ()) this->SendNextRequest (dest); }; msg->onDrop = [this, dest]() { if (dest->IsActive ()) this->SendNextRequest (dest); };
i2p::transport::transports.SendMessage (nextFloodfill->GetIdentHash (), msg); i2p::transport::transports.SendMessage (nextFloodfill->GetIdentHash (), msg);
@ -231,7 +232,8 @@ namespace data
auto inbound = pool->GetNextInboundTunnel (); auto inbound = pool->GetNextInboundTunnel ();
if (nextFloodfill && outbound && inbound) 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); auto msg = dest->CreateRequestMessage (nextFloodfill, inbound);
msg->onDrop = [this, dest]() { if (dest->IsActive ()) this->SendNextRequest (dest); }; msg->onDrop = [this, dest]() { if (dest->IsActive ()) this->SendNextRequest (dest); };
outbound->SendTunnelDataMsgTo (nextFloodfill->GetIdentHash (), 0, outbound->SendTunnelDataMsgTo (nextFloodfill->GetIdentHash (), 0,

Loading…
Cancel
Save