From f7a6d57855b60311bbc4a8f043402afd2a8fd4d0 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 13 Dec 2018 09:53:16 -0500 Subject: [PATCH] fixed bug with loval destination shared between http and socks proxy --- libi2pd_client/ClientContext.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libi2pd_client/ClientContext.cpp b/libi2pd_client/ClientContext.cpp index 3481d9c9..abaab749 100644 --- a/libi2pd_client/ClientContext.cpp +++ b/libi2pd_client/ClientContext.cpp @@ -345,11 +345,8 @@ namespace client { LogPrint (eLogWarning, "Clients: Local destination ", m_AddressBook.ToAddress(keys.GetPublic ()->GetIdentHash ()), " exists"); if (!it->second->IsRunning ()) - { it->second->Start (); - return it->second; - } - return nullptr; + return it->second; } auto localDestination = std::make_shared (keys, isPublic, params); std::unique_lock l(m_DestinationsMutex); @@ -719,7 +716,7 @@ namespace client std::map params; ReadI2CPOptionsFromConfig ("httpproxy.", params); localDestination = CreateNewLocalDestination (keys, false, ¶ms); - localDestination->Acquire (); + if (localDestination) localDestination->Acquire (); } else LogPrint(eLogError, "Clients: failed to load HTTP Proxy key"); @@ -758,7 +755,7 @@ namespace client std::map params; ReadI2CPOptionsFromConfig ("socksproxy.", params); localDestination = CreateNewLocalDestination (keys, false, ¶ms); - localDestination->Acquire (); + if (localDestination) localDestination->Acquire (); } else LogPrint(eLogError, "Clients: failed to load SOCKS Proxy key");