lower path build timeout to 15s

tweak various dns stuff
pull/285/head
Jeff Becker 5 years ago
parent 735ad9d32a
commit b40055181d
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -277,9 +277,9 @@ namespace llarp
context->ForEachService(
[&](const std::string &,
const std::unique_ptr< service::Endpoint > &service) -> bool {
if(service->HasIfAddr())
huint32_t ip = service->GetIfAddr();
if(ip.h)
{
huint32_t ip = service->GetIfAddr();
msg.AddINReply(ip);
++counter;
}
@ -297,10 +297,9 @@ namespace llarp
}
else
{
service::Endpoint::PathEnsureHook hook = [&](service::Address addr,
OutboundContext *ctx) {
this->SendDNSReply(addr, ctx, std::move(msg), reply);
};
service::Endpoint::PathEnsureHook hook = std::bind(
&TunEndpoint::SendDNSReply, this, std::placeholders::_1,
std::placeholders::_2, std::move(msg), reply);
return EnsurePathToService(addr, hook, 2000);
}
}
@ -398,7 +397,7 @@ namespace llarp
void
TunEndpoint::SendDNSReply(service::Address addr,
service::Endpoint::OutboundContext *ctx,
dns::Message &&request,
dns::Message request,
std::function< void(dns::Message) > reply)
{
if(ctx)

@ -191,8 +191,7 @@ namespace llarp
void
SendDNSReply(service::Address addr,
service::Endpoint::OutboundContext* ctx,
dns::Message&& query,
service::Endpoint::OutboundContext* ctx, dns::Message query,
std::function< void(dns::Message) > reply);
#ifndef WIN32

@ -26,7 +26,7 @@
#define DEFAULT_HOP_LENGTH (4)
#endif
#define DEFAULT_PATH_LIFETIME (10 * 60 * 1000)
#define PATH_BUILD_TIMEOUT (30 * 1000)
#define PATH_BUILD_TIMEOUT (15 * 1000)
#define MESSAGE_PAD_SIZE (128)
#define PATH_ALIVE_TIMEOUT (10 * 1000)

@ -171,7 +171,6 @@ namespace llarp
}
// expire pending tx
{
std::set< service::IntroSet > empty;
auto itr = m_PendingLookups.begin();
while(itr != m_PendingLookups.end())
{
@ -180,14 +179,13 @@ namespace llarp
std::unique_ptr< IServiceLookup > lookup = std::move(itr->second);
llarp::LogInfo(lookup->name, " timed out txid=", lookup->txid);
lookup->HandleResponse(empty);
lookup->HandleResponse({});
itr = m_PendingLookups.erase(itr);
}
else
++itr;
}
}
// expire pending router lookups
{
auto itr = m_PendingRouters.begin();
@ -1042,7 +1040,7 @@ namespace llarp
std::bind(&Endpoint::OnLookup, this, std::placeholders::_1,
std::placeholders::_2, std::placeholders::_3),
remote, GenTXID());
llarp::LogInfo("doing lookup for ", remote, " via ", path->Endpoint());
if(job->SendRequestViaPath(path, Router()))
return true;
llarp::LogError("send via path failed");

Loading…
Cancel
Save