pull/2021/head
jeff 2 years ago
parent e5b7ea5f2d
commit 011bd2e84f

@ -129,7 +129,6 @@ namespace llarp::dns
std::optional<SockAddr> m_LocalAddr; std::optional<SockAddr> m_LocalAddr;
std::set<int> m_Pending; std::set<int> m_Pending;
struct ub_result_deleter struct ub_result_deleter
{ {
void void
@ -170,8 +169,8 @@ namespace llarp::dns
buf.cur = buf.base; buf.cur = buf.base;
hdr.Encode(&buf); hdr.Encode(&buf);
// remove pending query // remove pending query
if(auto ptr = query->parent.lock()) if (auto ptr = query->parent.lock())
ptr->call([id=query->id, ptr]() { ptr->m_Pending.erase(id); }); ptr->call([id = query->id, ptr]() { ptr->m_Pending.erase(id); });
// send reply // send reply
query->SendReply(std::move(pkt)); query->SendReply(std::move(pkt));
} }
@ -415,7 +414,7 @@ namespace llarp::dns
// cancel pending queries // cancel pending queries
// make copy as ub_cancel modifies m_Pending // make copy as ub_cancel modifies m_Pending
const auto pending = m_Pending; const auto pending = m_Pending;
for(auto id : pending) for (auto id : pending)
::ub_cancel(m_ctx, id); ::ub_cancel(m_ctx, id);
m_Pending.clear(); m_Pending.clear();
@ -490,7 +489,7 @@ namespace llarp::dns
return true; return true;
} }
} }
if(not m_ctx) if (not m_ctx)
{ {
// we are down // we are down
tmp->Cancel(); tmp->Cancel();

@ -1088,8 +1088,8 @@ namespace llarp
} }
} }
// if we need more sessions to routers and we are not a service node kicked from the network or we are a client // if we need more sessions to routers and we are not a service node kicked from the network or
// we shall connect out to others // we are a client we shall connect out to others
if (connected < connectToNum and (LooksFunded() or not isSvcNode)) if (connected < connectToNum and (LooksFunded() or not isSvcNode))
{ {
size_t dlt = connectToNum - connected; size_t dlt = connectToNum - connected;

Loading…
Cancel
Save