|
|
|
@ -9,12 +9,13 @@ namespace llarp
|
|
|
|
|
namespace dns
|
|
|
|
|
{
|
|
|
|
|
Proxy::Proxy(llarp_ev_loop_ptr serverLoop, Logic_ptr serverLogic,
|
|
|
|
|
llarp_ev_loop_ptr clientLoop, Logic_ptr clientLogic, IQueryHandler* h)
|
|
|
|
|
: m_ServerLoop(serverLoop),
|
|
|
|
|
m_ServerLogic(serverLogic),
|
|
|
|
|
m_ClientLoop(clientLoop),
|
|
|
|
|
m_ClientLogic(clientLogic),
|
|
|
|
|
m_QueryHandler(h)
|
|
|
|
|
llarp_ev_loop_ptr clientLoop, Logic_ptr clientLogic,
|
|
|
|
|
IQueryHandler* h)
|
|
|
|
|
: m_ServerLoop(serverLoop)
|
|
|
|
|
, m_ServerLogic(serverLogic)
|
|
|
|
|
, m_ClientLoop(clientLoop)
|
|
|
|
|
, m_ClientLogic(clientLogic)
|
|
|
|
|
, m_QueryHandler(h)
|
|
|
|
|
{
|
|
|
|
|
m_Client.user = this;
|
|
|
|
|
m_Server.user = this;
|
|
|
|
@ -127,7 +128,7 @@ namespace llarp
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
const Addr requester = itr->second;
|
|
|
|
|
std::vector<byte_t> tmp(pkt->sz);
|
|
|
|
|
std::vector< byte_t > tmp(pkt->sz);
|
|
|
|
|
std::copy_n(pkt->cur, pkt->sz, tmp.begin());
|
|
|
|
|
auto self = shared_from_this();
|
|
|
|
|
m_ServerLogic->queue_func([=]() {
|
|
|
|
@ -180,7 +181,7 @@ namespace llarp
|
|
|
|
|
// new forwarded query
|
|
|
|
|
tx.from = PickRandomResolver();
|
|
|
|
|
m_Forwarded[tx] = from;
|
|
|
|
|
std::vector<byte_t> tmp(pkt->sz);
|
|
|
|
|
std::vector< byte_t > tmp(pkt->sz);
|
|
|
|
|
std::copy_n(pkt->cur, pkt->sz, tmp.begin());
|
|
|
|
|
|
|
|
|
|
m_ClientLogic->queue_func([=] {
|
|
|
|
|