mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-09-09 18:16:11 +00:00
own BOB proxy tunnels by shared_ptr
This commit is contained in:
@@ -507,7 +507,7 @@ namespace client
|
||||
case TunnelType::SOCKS:
|
||||
try
|
||||
{
|
||||
auto SocksProxy = std::make_unique<i2p::proxy::SOCKSProxy>(m_Nickname, m_InHost, m_InPort,
|
||||
auto SocksProxy = std::make_shared<i2p::proxy::SOCKSProxy>(m_Nickname, m_InHost, m_InPort,
|
||||
false, m_OutHost, m_OutPort, m_CurrentDestination->GetLocalDestination());
|
||||
SocksProxy->Start();
|
||||
m_Owner.SetProxy(m_Nickname, std::move(SocksProxy));
|
||||
@@ -521,7 +521,7 @@ namespace client
|
||||
case TunnelType::HTTP_PROXY:
|
||||
try
|
||||
{
|
||||
auto HttpProxy = std::make_unique<i2p::proxy::HTTPProxy>(m_Nickname, m_InHost, m_InPort,
|
||||
auto HttpProxy = std::make_shared<i2p::proxy::HTTPProxy>(m_Nickname, m_InHost, m_InPort,
|
||||
m_OutHost, true, true, m_CurrentDestination->GetLocalDestination());
|
||||
HttpProxy->Start();
|
||||
m_Owner.SetProxy(m_Nickname, std::move(HttpProxy));
|
||||
@@ -1113,7 +1113,7 @@ namespace client
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void BOBCommandChannel::SetProxy (const std::string& name, std::unique_ptr<I2PService> proxy)
|
||||
void BOBCommandChannel::SetProxy (const std::string& name, std::shared_ptr<I2PService> proxy)
|
||||
{
|
||||
m_proxy[name] = std::move(proxy);
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ namespace client
|
||||
void AddDestination (const std::string& name, std::shared_ptr<BOBDestination> dest);
|
||||
void DeleteDestination (const std::string& name);
|
||||
std::shared_ptr<BOBDestination> FindDestination (const std::string& name);
|
||||
void SetProxy (const std::string& name, std::unique_ptr<I2PService> proxy);
|
||||
void SetProxy (const std::string& name, std::shared_ptr<I2PService> proxy);
|
||||
const I2PService* GetProxy(const std::string& name) const;
|
||||
void RemoveProxy(const std::string& name);
|
||||
|
||||
@@ -314,7 +314,8 @@ namespace client
|
||||
std::map<std::string, std::shared_ptr<BOBDestination> > m_Destinations;
|
||||
std::map<std::string_view, BOBCommandHandler> m_CommandHandlers;
|
||||
std::map<std::string_view, std::string_view> m_HelpStrings;
|
||||
std::map<std::string, std::unique_ptr<I2PService>> m_proxy;
|
||||
// shared, a proxy takes a reference to itself when it accepts a connection
|
||||
std::map<std::string, std::shared_ptr<I2PService>> m_proxy;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user