|
|
|
@ -335,7 +335,6 @@ func (tp *torProvider) restart() {
|
|
|
|
|
}
|
|
|
|
|
tp.lastRestartTime = time.Now()
|
|
|
|
|
tp.isClosed = false
|
|
|
|
|
tp.t.Control.TakeOwnership()
|
|
|
|
|
go tp.monitorRestart()
|
|
|
|
|
} else {
|
|
|
|
|
log.Errorf("Error restarting Tor process: %v", err)
|
|
|
|
@ -432,7 +431,6 @@ func NewTorACNWithAuth(appDirectory string, bundledTorPath string, dataDir strin
|
|
|
|
|
tp, err := startTor(appDirectory, bundledTorPath, dataDir, controlPort, authenticator)
|
|
|
|
|
if err == nil {
|
|
|
|
|
tp.isClosed = false
|
|
|
|
|
tp.t.Control.TakeOwnership()
|
|
|
|
|
go tp.monitorRestart()
|
|
|
|
|
}
|
|
|
|
|
return tp, err
|
|
|
|
@ -488,9 +486,9 @@ func startTor(appDirectory string, bundledTorPath string, dataDir string, contro
|
|
|
|
|
if err == nil {
|
|
|
|
|
log.Debugf("creating tor handler from system tor")
|
|
|
|
|
tp.t = createFromExisting(controlport, dataDir)
|
|
|
|
|
tp.dialer, err = tp.t.Dialer(context.TODO(), &tor.DialConf{Authenticator: tp.authenticator})
|
|
|
|
|
return tp, err
|
|
|
|
|
}
|
|
|
|
|
tp.dialer, err = tp.t.Dialer(context.TODO(), &tor.DialConf{Authenticator: tp.authenticator})
|
|
|
|
|
return tp, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// check if the torrc file is present where expected
|
|
|
|
@ -529,6 +527,7 @@ func startTor(appDirectory string, bundledTorPath string, dataDir string, contro
|
|
|
|
|
tp.t.DeleteDataDirOnClose = false // caller is responsible for dealing with cached information...
|
|
|
|
|
tp.dialer, err = tp.t.Dialer(context.TODO(), &tor.DialConf{Authenticator: tp.authenticator})
|
|
|
|
|
tp.version = version
|
|
|
|
|
tp.t.Control.TakeOwnership()
|
|
|
|
|
return tp, err
|
|
|
|
|
}
|
|
|
|
|
return nil, fmt.Errorf("could not connect to running tor: %v", err)
|
|
|
|
|