mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
fixups in service endpoint
* increase publish introset timeout so that it does not time out on the network * remove pedantic log warn * make sure the path we are using for replying on inbound sessions is alive * include convotag in log message so we know wtf is going on * appease tom's autism, improve log message text
This commit is contained in:
parent
d53945b011
commit
d3d929efa7
|
@ -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…
Reference in a new issue