logging, fix hidden services

pull/81/head
Jeff Becker 6 years ago
parent 104e9c7ec9
commit 0ac6deff00
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -104,6 +104,7 @@ namespace llarp
else if(!GetNextPeer(peer, peersAsked))
{
// no more peers
llarp::LogInfo("no more peers for request asking for", target);
return false;
}
@ -111,6 +112,7 @@ namespace llarp
if((prevPeer ^ targetKey) < (peer ^ targetKey))
{
// next peer is not closer
llarp::LogInfo("next peer ", peer, " is not closer to ", target, " than ", prevPeer);
return false;
}
else
@ -302,6 +304,7 @@ namespace llarp
{
(void)whoasked;
tx.emplace(askpeer, std::unique_ptr< TX< K, V > >(t));
auto count = waiting.count(k);
waiting.insert(std::make_pair(k, askpeer));
auto itr = timeouts.find(k);
@ -310,6 +313,7 @@ namespace llarp
timeouts.insert(
std::make_pair(k, time_now_ms() + requestTimeoutMS));
}
if(count == 0)
t->Start(askpeer);
}

@ -137,8 +137,13 @@ namespace llarp
HandleDataMessage(const PathID_t&, ProtocolMessage* msg);
virtual bool
ProcessDataMessage(__attribute__((unused)) ProtocolMessage* msg)
ProcessDataMessage(ProtocolMessage* msg)
{
#ifdef TESTNET
llarp::LogInfo("Got message from ", msg->sender.Addr());
#else
(void) msg;
#endif
return true;
}

@ -163,13 +163,7 @@ llarp_router::PersistSessionUntil(const llarp::RouterID &remote,
llarp_time_t until)
{
llarp::LogDebug("persist session to ", remote, " until ", until);
if(m_PersistingSessions.find(remote) == m_PersistingSessions.end())
m_PersistingSessions[remote] = until;
else
{
if(m_PersistingSessions[remote] < until)
m_PersistingSessions[remote] = until;
}
m_PersistingSessions[remote] = std::max(until, m_PersistingSessions[remote]);
}
constexpr size_t MaxPendingSendQueueSize = 8;

@ -94,7 +94,7 @@ namespace llarp
llarp::LogWarn("could not publish descriptors for endpoint ", Name(),
" because we couldn't get enough valid introductions");
if(ShouldBuildMore(now) || forceRebuild)
ManualRebuild(1, llarp::path::ePathRoleInboundHS);
ManualRebuild(1);
return;
}
m_IntroSet.I.clear();
@ -1113,9 +1113,9 @@ namespace llarp
}
}
// no converstation
EnsurePathToService(remote, [](Address, OutboundContext*) {}, 5000,
false);
return false;
return EnsurePathToService(remote, [](Address, OutboundContext* c) {
if(c) c->UpdateIntroSet(true);
}, 5000, false);
}
bool
@ -1159,7 +1159,7 @@ namespace llarp
}
return false;
}
Build(hops, llarp::path::ePathRoleOutboundHS);
Build(hops);
return true;
}
@ -1529,8 +1529,7 @@ namespace llarp
}
}
(void)roles;
return path::Builder::SelectHop(db, prev, cur, hop,
llarp::path::ePathRoleOutboundHS);
return path::Builder::SelectHop(db, prev, cur, hop, roles);
}
uint64_t
@ -1547,8 +1546,7 @@ namespace llarp
{
if(markedBad)
return false;
bool should = path::Builder::ShouldBuildMoreForRoles(
now, llarp::path::ePathRoleOutboundHS);
bool should = path::Builder::ShouldBuildMore(now);
// determinte newest intro
Introduction intro;
if(!GetNewestIntro(intro))

Loading…
Cancel
Save