diff --git a/Daemon.cpp b/Daemon.cpp index 2b4f5e8e..d0242bf7 100644 --- a/Daemon.cpp +++ b/Daemon.cpp @@ -127,7 +127,7 @@ namespace i2p i2p::stream::StreamingDestination * localDestination = nullptr; std::string ircKeys = i2p::util::config::GetArg("-irckeys", ""); if (ircKeys.length () > 0) - localDestination = i2p::stream::LoadLocalDestination (ircKeys); + localDestination = i2p::stream::LoadLocalDestination (ircKeys, false); d.ircTunnel = new i2p::stream::I2PClientTunnel (d.socksProxy->GetService (), ircDestination, i2p::util::config::GetArg("-ircport", 6668), localDestination); d.ircTunnel->Start (); @@ -136,7 +136,7 @@ namespace i2p std::string eepKeys = i2p::util::config::GetArg("-eepkeys", ""); if (eepKeys.length () > 0) // eepkeys file is presented { - auto localDestination = i2p::stream::LoadLocalDestination (eepKeys); + auto localDestination = i2p::stream::LoadLocalDestination (eepKeys, true); d.serverTunnel = new i2p::stream::I2PServerTunnel (d.socksProxy->GetService (), i2p::util::config::GetArg("-eephost", "127.0.0.1"), i2p::util::config::GetArg("-eepport", 80), localDestination); diff --git a/Streaming.cpp b/Streaming.cpp index 4536c62b..05be28f6 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -519,8 +519,8 @@ namespace stream LogPrint ("Local address ", GetIdentHash ().ToBase32 (), ".b32.i2p created"); } - StreamingDestination::StreamingDestination (boost::asio::io_service& service, const std::string& fullPath): - m_Service (service), m_LeaseSet (nullptr), m_IsPublic (true) + StreamingDestination::StreamingDestination (boost::asio::io_service& service, const std::string& fullPath, bool isPublic): + m_Service (service), m_LeaseSet (nullptr), m_IsPublic (isPublic) { std::ifstream s(fullPath.c_str (), std::ifstream::binary); if (s.is_open ()) @@ -704,7 +704,7 @@ namespace stream #else it->path(); #endif - auto localDestination = new StreamingDestination (m_Service, fullPath); + auto localDestination = new StreamingDestination (m_Service, fullPath, true); m_Destinations[localDestination->GetIdentHash ()] = localDestination; numDestinations++; } @@ -713,9 +713,9 @@ namespace stream LogPrint (numDestinations, " local destinations loaded"); } - StreamingDestination * StreamingDestinations::LoadLocalDestination (const std::string& filename) + StreamingDestination * StreamingDestinations::LoadLocalDestination (const std::string& filename, bool isPublic) { - auto localDestination = new StreamingDestination (m_Service, i2p::util::filesystem::GetFullPath (filename)); + auto localDestination = new StreamingDestination (m_Service, i2p::util::filesystem::GetFullPath (filename), isPublic); m_Destinations[localDestination->GetIdentHash ()] = localDestination; return localDestination; } @@ -840,9 +840,9 @@ namespace stream return destinations.FindLocalDestination (destination); } - StreamingDestination * LoadLocalDestination (const std::string& filename) + StreamingDestination * LoadLocalDestination (const std::string& filename, bool isPublic) { - return destinations.LoadLocalDestination (filename); + return destinations.LoadLocalDestination (filename, isPublic); } const StreamingDestinations& GetLocalDestinations () diff --git a/Streaming.h b/Streaming.h index b69828b2..4c2e4fec 100644 --- a/Streaming.h +++ b/Streaming.h @@ -143,7 +143,7 @@ namespace stream public: StreamingDestination (boost::asio::io_service& service, bool isPublic); - StreamingDestination (boost::asio::io_service& service, const std::string& fullPath); + StreamingDestination (boost::asio::io_service& service, const std::string& fullPath, bool isPublic); StreamingDestination (boost::asio::io_service& service, const i2p::data::PrivateKeys& keys, bool isPublic); ~StreamingDestination (); @@ -202,7 +202,7 @@ namespace stream void DeleteLocalDestination (StreamingDestination * destination); StreamingDestination * GetLocalDestination (const i2p::data::PrivateKeys& keys, bool isPublic); StreamingDestination * FindLocalDestination (const i2p::data::IdentHash& destination) const; - StreamingDestination * LoadLocalDestination (const std::string& filename); + StreamingDestination * LoadLocalDestination (const std::string& filename, bool isPublic); private: @@ -234,7 +234,7 @@ namespace stream void DeleteLocalDestination (StreamingDestination * destination); StreamingDestination * GetLocalDestination (const i2p::data::PrivateKeys& keys, bool isPublic = true); StreamingDestination * FindLocalDestination (const i2p::data::IdentHash& destination); - StreamingDestination * LoadLocalDestination (const std::string& filename); + StreamingDestination * LoadLocalDestination (const std::string& filename, bool isPublic); // for HTTP const StreamingDestinations& GetLocalDestinations ();