avoid launching hidden service twice

This commit is contained in:
csoler 2017-12-26 18:44:15 +01:00
parent 1a9a9ca208
commit 355a0b42e9

View File

@ -95,6 +95,7 @@ TorManagerPrivate::TorManagerPrivate(TorManager *parent)
, process(0) , process(0)
, control(new TorControl(this)) , control(new TorControl(this))
, configNeeded(false) , configNeeded(false)
, hiddenService(NULL)
{ {
connect(control, SIGNAL(statusChanged(int,int)), SLOT(controlStatusChanged(int))); connect(control, SIGNAL(statusChanged(int,int)), SLOT(controlStatusChanged(int)));
} }
@ -144,6 +145,12 @@ void TorManager::setHiddenServiceDirectory(const QString &path)
bool TorManager::setupHiddenService() bool TorManager::setupHiddenService()
{ {
if(d->hiddenService != NULL)
{
std::cerr << "TorManager: setupHiddenService() called twice! Not doing anything this time." << std::endl;
return true ;
}
QString keyData ;//= m_settings->read("serviceKey").toString(); QString keyData ;//= m_settings->read("serviceKey").toString();
QString legacyDir = d->hiddenServiceDir; QString legacyDir = d->hiddenServiceDir;