mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-24 23:19:29 -05:00
commit
35e20222e4
@ -141,6 +141,12 @@ public:
|
|||||||
*/
|
*/
|
||||||
static bool start();
|
static bool start();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief stop
|
||||||
|
* Stop the Tor management threads.
|
||||||
|
*/
|
||||||
|
static void stop();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief getHiddenServiceInfo
|
* \brief getHiddenServiceInfo
|
||||||
* Gets information about the hidden service setup by RS to run.
|
* Gets information about the hidden service setup by RS to run.
|
||||||
|
@ -53,6 +53,8 @@
|
|||||||
|
|
||||||
using namespace Tor;
|
using namespace Tor;
|
||||||
|
|
||||||
|
static TorManager *rsTor = nullptr;
|
||||||
|
|
||||||
namespace Tor
|
namespace Tor
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -462,7 +464,7 @@ void TorManager::run()
|
|||||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||||
}
|
}
|
||||||
|
|
||||||
d->control->shutdown();
|
d->control->shutdownSync();
|
||||||
d->process->stop();
|
d->process->stop();
|
||||||
|
|
||||||
if(rsEvents)
|
if(rsEvents)
|
||||||
@ -840,6 +842,17 @@ bool RsTor::start()
|
|||||||
return instance()->startTorManager();
|
return instance()->startTorManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RsTor::stop()
|
||||||
|
{
|
||||||
|
if (rsTor) {
|
||||||
|
if (rsTor->isRunning()) {
|
||||||
|
rsTor->fullstop();
|
||||||
|
}
|
||||||
|
delete(rsTor);
|
||||||
|
rsTor= nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void RsTor::setTorDataDirectory(const std::string& dir)
|
void RsTor::setTorDataDirectory(const std::string& dir)
|
||||||
{
|
{
|
||||||
instance()->setTorDataDirectory(dir);
|
instance()->setTorDataDirectory(dir);
|
||||||
@ -855,8 +868,6 @@ TorManager *RsTor::instance()
|
|||||||
assert(getpid() == syscall(SYS_gettid));// make sure we're not in a thread
|
assert(getpid() == syscall(SYS_gettid));// make sure we're not in a thread
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static TorManager *rsTor = nullptr;
|
|
||||||
|
|
||||||
if(rsTor == nullptr)
|
if(rsTor == nullptr)
|
||||||
rsTor = new TorManager;
|
rsTor = new TorManager;
|
||||||
|
|
||||||
|
@ -591,6 +591,10 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
|
|||||||
RsGxsUpdateBroadcast::cleanup();
|
RsGxsUpdateBroadcast::cleanup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (is_auto_tor) {
|
||||||
|
RsTor::stop();
|
||||||
|
}
|
||||||
|
|
||||||
RsControl::instance()->rsGlobalShutDown();
|
RsControl::instance()->rsGlobalShutDown();
|
||||||
|
|
||||||
delete(soundManager);
|
delete(soundManager);
|
||||||
|
Loading…
Reference in New Issue
Block a user