diff -U2 -r /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd_client/ClientContext.cpp /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd_client/ClientContext.cpp --- /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd_client/ClientContext.cpp 2026-09-24 02:22:13.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd_client/ClientContext.cpp 2026-09-24 02:19:01.000000000 +0000 @@ -9,5 +9,4 @@ #include #include -#include #include #include @@ -633,48 +632,4 @@ } - void ClientContext::AddSection (boost::property_tree::ptree& pt, const std::string& name, - const std::string& chunk, int& numSections) - { - if (chunk.empty ()) return; - boost::property_tree::ptree section; - try - { - std::stringstream ss (chunk); - boost::property_tree::read_ini (ss, section); - } - catch (std::exception& ex) - { - LogPrint (eLogWarning, "Clients: Skipped ", name.empty () ? "tunnels config header" : name, ": ", ex.what ()); - return; - } - for (auto& it: section) - pt.push_back (it); - numSections++; - } - - // 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 - int ClientContext::ReadTunnelsBySection (const std::string& tunConf, boost::property_tree::ptree& pt) - { - std::ifstream f (tunConf); - if (!f.is_open ()) return 0; - int numSections = 0; - std::string line, chunk, name; - while (std::getline (f, line)) - { - auto start = line.find_first_not_of (" \t"); - if (start != std::string::npos && line[start] == '[') - { - AddSection (pt, name, chunk, numSections); - chunk.clear (); - name = line.substr (start); - } - chunk += line; chunk += "\n"; - } - AddSection (pt, name, chunk, numSections); - return numSections; - } - void ClientContext::ReadTunnels (const std::string& tunConf, int& numClientTunnels, int& numServerTunnels) { @@ -684,8 +639,5 @@ } catch (std::exception& ex) { LogPrint (eLogWarning, "Clients: Can't read ", tunConf, ": ", ex.what ()); - pt.clear (); - int numSections = ReadTunnelsBySection (tunConf, pt); - if (!numSections) return; - LogPrint (eLogWarning, "Clients: ", tunConf, " read section by section, ", numSections, " section(s) accepted"); + return; } diff -U2 -r /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd_client/ClientContext.h /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd_client/ClientContext.h --- /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd_client/ClientContext.h 2026-09-24 02:22:13.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd_client/ClientContext.h 2026-09-24 02:19:01.000000000 +0000 @@ -18,5 +18,4 @@ #include #include -#include #include "Destination.h" #include "I2PService.h" @@ -135,6 +134,4 @@ 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 ();