Merge pull request #1627 from majestrate/service-endpoint-fixups-2021-05-05

fixups in service endpont
pull/1633/head
Jeff 3 years ago committed by GitHub
commit 0472b790a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -222,7 +222,7 @@ namespace llarp
std::function<void(dns::Message)> reply,
bool sendIPv6)
{
if (ctx)
if (ctx or HasAddress(addr))
{
huint128_t ip = ObtainIPForAddr(addr);
query->answers.clear();

@ -622,8 +622,12 @@ namespace llarp
Endpoint* m_Endpoint;
uint64_t m_relayOrder;
PublishIntroSetJob(
Endpoint* parent, uint64_t id, EncryptedIntroSet introset, uint64_t relayOrder)
: IServiceLookup(parent, id, "PublishIntroSet")
Endpoint* parent,
uint64_t id,
EncryptedIntroSet introset,
uint64_t relayOrder,
llarp_time_t timeout)
: IServiceLookup(parent, id, "PublishIntroSet", timeout)
, m_IntroSet(std::move(introset))
, m_Endpoint(parent)
, m_relayOrder(relayOrder)
@ -665,6 +669,8 @@ namespace llarp
}
}
constexpr auto PublishIntrosetTimeout = 20s;
bool
Endpoint::PublishIntroSetVia(
const EncryptedIntroSet& introset,
@ -672,7 +678,8 @@ namespace llarp
path::Path_ptr path,
uint64_t relayOrder)
{
auto job = new PublishIntroSetJob(this, GenTXID(), introset, relayOrder);
auto job =
new PublishIntroSetJob(this, GenTXID(), introset, relayOrder, PublishIntrosetTimeout);
if (job->SendRequestViaPath(path, r))
{
m_state->m_LastPublishAttempt = Now();
@ -1605,7 +1612,7 @@ namespace llarp
if (session.inbound)
{
auto path = GetPathByRouter(session.replyIntro.router);
if (path)
if (path and path->IsReady())
{
const auto rttEstimate = (session.replyIntro.latency + path->intro.latency) * 2;
if (rttEstimate < rtt)
@ -1614,10 +1621,6 @@ namespace llarp
rtt = rttEstimate;
}
}
else
{
LogWarn("no path for inbound session T=", tag);
}
}
else
{

@ -567,7 +567,7 @@ namespace llarp
// verify source
if (!frame.Verify(si))
{
LogWarn("signature failed");
LogWarn("signature verification failed, T=", frame.T);
return false;
}
// remove convotag it doesn't exist

Loading…
Cancel
Save