From 47ebb6ae6c1692bf8d4e21ca79c08e03aab9e3eb Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sun, 21 Aug 2016 22:11:41 -0400 Subject: [PATCH] osx fix --- ClientContext.cpp | 21 +++++++++++---------- I2PTunnel.cpp | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ClientContext.cpp b/ClientContext.cpp index de06a465..0b9b1f60 100644 --- a/ClientContext.cpp +++ b/ClientContext.cpp @@ -43,15 +43,6 @@ namespace client m_AddressBook.Start (); - if ( m_ServiceThread == nullptr ) { - m_ServiceThread = new std::thread([&] () { - LogPrint(eLogInfo, "ClientContext: starting service"); - m_Service.run(); - LogPrint(eLogError, "ClientContext: service died"); - }); - ScheduleCleanupUDP(); - } - std::shared_ptr localDestination; bool httproxy; i2p::config::GetOption("httpproxy.enabled", httproxy); if (httproxy) { @@ -74,7 +65,7 @@ namespace client LogPrint(eLogError, "Clients: Exception in HTTP Proxy: ", e.what()); } } - + bool socksproxy; i2p::config::GetOption("socksproxy.enabled", socksproxy); if (socksproxy) { std::string socksProxyKeys; i2p::config::GetOption("socksproxy.keys", socksProxyKeys); @@ -100,6 +91,16 @@ namespace client // I2P tunnels ReadTunnels (); + if ( m_ServiceThread == nullptr ) { + m_ServiceThread = new std::thread([&] () { + LogPrint(eLogInfo, "ClientContext: starting service"); + m_Service.run(); + LogPrint(eLogError, "ClientContext: service died"); + }); + ScheduleCleanupUDP(); + } + + // SAM bool sam; i2p::config::GetOption("sam.enabled", sam); if (sam) { diff --git a/I2PTunnel.cpp b/I2PTunnel.cpp index 531eea87..a2811695 100644 --- a/I2PTunnel.cpp +++ b/I2PTunnel.cpp @@ -628,6 +628,7 @@ namespace client LogPrint(eLogInfo, "UDP Tunnel: Trying to resolve ", m_RemoteDest); m_RemoteIdent = new i2p::data::IdentHash; m_RemoteIdent->Fill(0); + while(!context.GetAddressBook().GetIdentHash(m_RemoteDest, *m_RemoteIdent) && !m_cancel_resolve) { LogPrint(eLogWarning, "UDP Tunnel: failed to lookup ", m_RemoteDest); std::this_thread::sleep_for(std::chrono::seconds(1));