add changes for review

pull/598/head
Jeff Becker 5 years ago
parent 3821b4801c
commit ad019cab71
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -229,17 +229,18 @@ namespace llarp
return;
}
}
if(!VisitEndpointsFor(pk, [&](exit::Endpoint *const ep) -> bool {
if(!ep->QueueInboundTraffic(ManagedBuffer{pkt.Buffer()}))
{
LogWarn(Name(), " dropped inbound traffic for session ", pk,
" as we are overloaded (probably)");
// continue iteration
return true;
}
// break iteration
return false;
}))
auto tryFlushingTraffic = [&](exit::Endpoint *const ep) -> bool {
if(!ep->QueueInboundTraffic(ManagedBuffer{pkt.Buffer()}))
{
LogWarn(Name(), " dropped inbound traffic for session ", pk,
" as we are overloaded (probably)");
// continue iteration
return true;
}
// break iteration
return false;
};
if(!VisitEndpointsFor(pk, tryFlushingTraffic))
{
// we may have all dead sessions, wtf now?
LogWarn(Name(), " dropped inbound traffic for session ", pk,

@ -309,8 +309,9 @@ namespace llarp
bool
operator<(const PathHopConfig& other) const
{
return txID < other.txID || rxID < other.rxID || rc < other.rc
|| upstream < other.upstream || lifetime < other.lifetime;
return std::tie(txID, rxID, rc, upstream, lifetime)
< std::tie(other.txID, other.rxID, other.rc, other.upstream,
other.lifetime);
}
};
@ -356,13 +357,7 @@ namespace llarp
bool
operator<(const Path& other) const
{
const auto sz = hops.size();
if(sz > other.hops.size())
return false;
for(size_t idx = 0; idx < sz; ++idx)
if(!(hops[idx] < other.hops[idx]))
return false;
return true;
return hops < other.hops;
}
void

Loading…
Cancel
Save