mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
Merge remote-tracking branch 'devnull/linux_tunnel_reload_on_hup'
This commit is contained in:
commit
6d54401d7c
@ -202,7 +202,13 @@ namespace client
|
|||||||
|
|
||||||
void ClientContext::ReloadConfig ()
|
void ClientContext::ReloadConfig ()
|
||||||
{
|
{
|
||||||
ReadTunnels (); // TODO: it reads new tunnels only, should be implemented better
|
/*
|
||||||
|
std::string config; i2p::config::GetOption("conf", config);
|
||||||
|
i2p::config::ParseConfig(config);
|
||||||
|
*/
|
||||||
|
//I don't think we can just reload the main config without making a mess of things, so holding off for now.
|
||||||
|
Stop();
|
||||||
|
Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientContext::LoadPrivateKeys (i2p::data::PrivateKeys& keys, const std::string& filename, i2p::data::SigningKeyType sigType)
|
void ClientContext::LoadPrivateKeys (i2p::data::PrivateKeys& keys, const std::string& filename, i2p::data::SigningKeyType sigType)
|
||||||
|
@ -13,14 +13,16 @@
|
|||||||
#include "FS.h"
|
#include "FS.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "RouterContext.h"
|
#include "RouterContext.h"
|
||||||
|
#include "ClientContext.h"
|
||||||
|
|
||||||
void handle_signal(int sig)
|
void handle_signal(int sig)
|
||||||
{
|
{
|
||||||
switch (sig)
|
switch (sig)
|
||||||
{
|
{
|
||||||
case SIGHUP:
|
case SIGHUP:
|
||||||
LogPrint(eLogInfo, "Daemon: Got SIGHUP, reopening log...");
|
LogPrint(eLogInfo, "Daemon: Got SIGHUP, reopening logs and tunnel configuration...");
|
||||||
i2p::log::Logger().Reopen ();
|
i2p::log::Logger().Reopen ();
|
||||||
|
i2p::client::context.ReloadConfig();
|
||||||
break;
|
break;
|
||||||
case SIGINT:
|
case SIGINT:
|
||||||
if (i2p::context.AcceptsTunnels () && !Daemon.gracefullShutdownInterval)
|
if (i2p::context.AcceptsTunnels () && !Daemon.gracefullShutdownInterval)
|
||||||
|
Loading…
Reference in New Issue
Block a user