From c908beade25cf53ae9ace75978e8f0a3d0a84814 Mon Sep 17 00:00:00 2001 From: /dev/null Date: Thu, 21 Jul 2016 17:57:43 -0600 Subject: [PATCH] Added client tunnel reload on SIGHUP for Linux --- ClientContext.cpp | 8 +++++++- DaemonLinux.cpp | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ClientContext.cpp b/ClientContext.cpp index 2bc13969..788e6a46 100644 --- a/ClientContext.cpp +++ b/ClientContext.cpp @@ -202,7 +202,13 @@ namespace client 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) diff --git a/DaemonLinux.cpp b/DaemonLinux.cpp index 118fc5f5..22d7dec8 100644 --- a/DaemonLinux.cpp +++ b/DaemonLinux.cpp @@ -13,14 +13,16 @@ #include "FS.h" #include "Log.h" #include "RouterContext.h" +#include "ClientContext.h" void handle_signal(int sig) { switch (sig) { case SIGHUP: - LogPrint(eLogInfo, "Daemon: Got SIGHUP, reopening log..."); + LogPrint(eLogInfo, "Daemon: Got SIGHUP, reopening logs and tunnel configuration..."); i2p::log::Logger().Reopen (); + i2p::client::context.ReloadConfig(); break; case SIGINT: if (i2p::context.AcceptsTunnels () && !Daemon.gracefullShutdownInterval)