mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-09 13:10:25 +00:00
34 lines
773 B
C++
34 lines
773 B
C++
#include <service/lookup.hpp>
|
|
|
|
#include <path/path.hpp>
|
|
#include <service/endpoint.hpp>
|
|
#include <util/time.hpp>
|
|
|
|
namespace llarp
|
|
{
|
|
struct AbstractRouter;
|
|
|
|
namespace service
|
|
{
|
|
IServiceLookup::IServiceLookup(ILookupHolder *p, uint64_t tx,
|
|
const std::string &n)
|
|
: parent(p), txid(tx), name(n)
|
|
{
|
|
m_created = time_now_ms();
|
|
p->PutLookup(this, tx);
|
|
}
|
|
|
|
bool
|
|
IServiceLookup::SendRequestViaPath(path::Path *path, AbstractRouter *r)
|
|
{
|
|
auto msg = BuildRequestMessage();
|
|
if(!msg)
|
|
return false;
|
|
auto result = path->SendRoutingMessage(msg, r);
|
|
endpoint = path->Endpoint();
|
|
delete msg;
|
|
return result;
|
|
}
|
|
} // namespace service
|
|
} // namespace llarp
|