added check after starting TorManager

This commit is contained in:
csoler 2018-01-20 17:10:47 +01:00
parent 15decacc0d
commit 0112cf23e5
6 changed files with 27 additions and 24 deletions

View file

@ -357,7 +357,12 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
RsDirUtil::checkCreateDirectory(std::string(tor_hidden_service_dir.toUtf8())) ;
torManager->setupHiddenService();
torManager->start();
if(! torManager->start() || torManager->hasError())
{
QMessageBox::critical(NULL,QObject::tr("Cannot start Tor Manager!"),QObject::tr("Tor cannot be started on your system: \n\n")+torManager->errorMessage()) ;
return 1 ;
}
{
TorControlDialog tcd(torManager) ;
@ -368,11 +373,6 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
QCoreApplication::processEvents();
usleep(0.2*1000*1000) ;
}
// for(uint32_t i=0;i<10;++i) // give some time (2 secs) to see what's going on
// {
// QCoreApplication::processEvents();
// usleep(0.2*1000*1000) ;
// }
tcd.hide();