mirror of https://github.com/oxen-io/lokinet
Merge pull request #1728 from jagerman/fix-arg-order-v2
Unbound callbacks also need arguments reversed
This commit is contained in:
commit
0447ffc829
|
@ -58,7 +58,7 @@ namespace llarp::dns
|
|||
return true;
|
||||
|
||||
auto failFunc = [self = weak_from_this()](
|
||||
const SockAddr& from, const SockAddr& to, Message msg) {
|
||||
const SockAddr& to, const SockAddr& from, Message msg) {
|
||||
if (auto this_ptr = self.lock())
|
||||
this_ptr->SendServerMessageBufferTo(to, from, msg.ToBuffer());
|
||||
};
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace llarp::dns
|
|||
{
|
||||
Message& msg = lookup->msg;
|
||||
msg.AddServFail();
|
||||
this_ptr->failFunc(lookup->resolverAddr, lookup->askerAddr, msg);
|
||||
this_ptr->failFunc(lookup->askerAddr, lookup->resolverAddr, msg);
|
||||
ub_resolve_free(result);
|
||||
return;
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ namespace llarp::dns
|
|||
buf.cur = buf.base;
|
||||
hdr.Encode(&buf);
|
||||
|
||||
this_ptr->replyFunc(lookup->resolverAddr, lookup->askerAddr, std::move(pkt));
|
||||
this_ptr->replyFunc(lookup->askerAddr, lookup->resolverAddr, std::move(pkt));
|
||||
|
||||
ub_resolve_free(result);
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ namespace llarp::dns
|
|||
if (not unboundContext)
|
||||
{
|
||||
msg.AddServFail();
|
||||
failFunc(to, from, std::move(msg));
|
||||
failFunc(from, to, std::move(msg));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ namespace llarp::dns
|
|||
if (err != 0)
|
||||
{
|
||||
msg.AddServFail();
|
||||
failFunc(to, from, std::move(msg));
|
||||
failFunc(from, to, std::move(msg));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
namespace llarp::dns
|
||||
{
|
||||
using ReplyFunction =
|
||||
std::function<void(const SockAddr& resolver, const SockAddr& source, OwnedBuffer buf)>;
|
||||
std::function<void(const SockAddr& reply_to, const SockAddr& from_resolver, OwnedBuffer buf)>;
|
||||
using FailFunction =
|
||||
std::function<void(const SockAddr& resolver, const SockAddr& source, Message msg)>;
|
||||
std::function<void(const SockAddr& reply_to, const SockAddr& from_resolver, Message msg)>;
|
||||
|
||||
class UnboundResolver : public std::enable_shared_from_this<UnboundResolver>
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue