2018-12-12 02:15:08 +00:00
|
|
|
#include <service/lookup.hpp>
|
2019-01-11 01:19:36 +00:00
|
|
|
|
|
|
|
#include <path/path.hpp>
|
2019-01-29 02:16:31 +00:00
|
|
|
#include <router/router.hpp>
|
2019-01-11 01:19:36 +00:00
|
|
|
#include <service/endpoint.hpp>
|
2019-01-10 19:41:51 +00:00
|
|
|
#include <util/time.hpp>
|
2018-08-04 02:59:32 +00:00
|
|
|
|
2018-07-18 03:10:21 +00:00
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace service
|
|
|
|
{
|
2018-08-14 21:17:18 +00:00
|
|
|
IServiceLookup::IServiceLookup(ILookupHolder *p, uint64_t tx,
|
|
|
|
const std::string &n)
|
|
|
|
: parent(p), txid(tx), name(n)
|
2018-08-04 02:59:32 +00:00
|
|
|
{
|
2018-11-19 22:45:37 +00:00
|
|
|
m_created = time_now_ms();
|
2018-08-04 02:59:32 +00:00
|
|
|
p->PutLookup(this, tx);
|
|
|
|
}
|
|
|
|
|
2018-07-18 03:10:21 +00:00
|
|
|
bool
|
2019-01-29 02:16:31 +00:00
|
|
|
IServiceLookup::SendRequestViaPath(path::Path *path, Router *r)
|
2018-07-18 03:10:21 +00:00
|
|
|
{
|
|
|
|
auto msg = BuildRequestMessage();
|
|
|
|
if(!msg)
|
|
|
|
return false;
|
|
|
|
auto result = path->SendRoutingMessage(msg, r);
|
2018-10-15 15:43:41 +00:00
|
|
|
endpoint = path->Endpoint();
|
2018-07-18 03:10:21 +00:00
|
|
|
delete msg;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
} // namespace service
|
2018-10-15 15:43:41 +00:00
|
|
|
} // namespace llarp
|