From 3852c7a4854bd7aa6ae55ff9ff43c3b84aad6c0f Mon Sep 17 00:00:00 2001 From: PobreGato <315121269+pobregat0@users.noreply.github.com> Date: Wed, 23 Sep 2026 22:18:00 -0400 Subject: [PATCH] make tunnels config section readers members of ClientContext --- libi2pd_client/ClientContext.cpp | 4 ++-- libi2pd_client/ClientContext.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libi2pd_client/ClientContext.cpp b/libi2pd_client/ClientContext.cpp index 06b05954..315173c3 100644 --- a/libi2pd_client/ClientContext.cpp +++ b/libi2pd_client/ClientContext.cpp @@ -632,7 +632,7 @@ namespace client LogPrint (eLogInfo, "Clients: ", numServerTunnels, " I2P server tunnels created"); } - static void AddSection (boost::property_tree::ptree& pt, const std::string& name, + void ClientContext::AddSection (boost::property_tree::ptree& pt, const std::string& name, const std::string& chunk, int& numSections) { if (chunk.empty ()) return; @@ -655,7 +655,7 @@ namespace client // Fallback for a file rejected as a whole: a single malformed line makes read_ini throw // and every tunnel is lost, including sections that are correct. Read section by section // instead, so that only unreadable ones are skipped - static int ReadTunnelsBySection (const std::string& tunConf, boost::property_tree::ptree& pt) + int ClientContext::ReadTunnelsBySection (const std::string& tunConf, boost::property_tree::ptree& pt) { std::ifstream f (tunConf); if (!f.is_open ()) return 0; diff --git a/libi2pd_client/ClientContext.h b/libi2pd_client/ClientContext.h index 09003cde..a726d29c 100644 --- a/libi2pd_client/ClientContext.h +++ b/libi2pd_client/ClientContext.h @@ -17,6 +17,7 @@ #include #include #include +#include #include "Destination.h" #include "I2PService.h" #include "I2PTunnel.h" @@ -133,6 +134,8 @@ namespace client void ReadTunnels (); void ReadTunnels (const std::string& tunConf, int& numClientTunnels, int& numServerTunnels); + int ReadTunnelsBySection (const std::string& tunConf, boost::property_tree::ptree& pt); + void AddSection (boost::property_tree::ptree& pt, const std::string& name, const std::string& chunk, int& numSections); void ReadHttpProxy (); void ReadSocksProxy (); // take the proxy out under the lock, so it can be stopped without holding it