more sighup code

pull/598/head
Jeff Becker 5 years ago
parent a53da68700
commit 7b03b63d13
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -355,6 +355,7 @@ __ ___ ____ _ _ ___ _ _ ____
llarp::LogInfo("Reset internal state for ", name);
return true;
});
router->PumpLL();
Config newconfig;
if(!newconfig.Load(configfile.c_str()))
{

@ -151,6 +151,23 @@ namespace llarp
m_PendingCallbacks.clear();
}
void
BaseSession::ResetInternalState()
{
auto sendExitClose = [&](const llarp::path::Path_ptr p) {
if(p->SupportsAnyRoles(llarp::path::ePathRoleExit | llarp::path::ePathRoleSVC))
{
llarp::LogInfo(p->Name(), " closing exit path");
llarp::routing::CloseExitMessage msg;
if(!(msg.Sign(router->crypto(), m_ExitIdentity)
&& p->SendExitClose(msg, router)))
llarp::LogWarn(p->Name(), " failed to send exit close message");
}
};
ForEachPath(sendExitClose);
path::Builder::ResetInternalState();
}
bool
BaseSession::Stop()
{

@ -48,6 +48,9 @@ namespace llarp
return m_BundleRC;
}
virtual void
ResetInternalState() override;
bool UrgentBuild(llarp_time_t) const override;
void

@ -153,7 +153,7 @@ namespace llarp
void
Flush();
void
virtual void
ResetInternalState() override;
protected:

@ -382,7 +382,7 @@ namespace llarp
bool
SupportsAnyRoles(PathRole roles) const
{
return roles == ePathRoleAny || (_role & roles) != 0;
return roles == ePathRoleAny || (_role | roles) != 0;
}
PathStatus

@ -185,6 +185,7 @@ namespace llarp
Builder::ResetInternalState()
{
buildIntervalLimit = MIN_PATH_BUILD_INTERVAL;
lastBuild = 0;
}
void

@ -604,7 +604,6 @@ namespace llarp
std::for_each(container.begin(), container.end(),
[](auto& item) { item.second->ResetInternalState(); });
};
resetState(m_RemoteSessions);
resetState(m_SNodeSessions);
}

Loading…
Cancel
Save