Merge pull request 'Fix Dialer issues on Restart' (#18) from fix-deadlock into master
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone/push Build is passing Details

Reviewed-on: #18
This commit is contained in:
erinn 2021-04-13 15:07:19 -07:00
commit 9bcea4aa0a
1 changed files with 3 additions and 0 deletions

View File

@ -236,7 +236,10 @@ func (tp *torProvider) restart() {
log.Debugf("Restarting Tor Process")
newTp, err := startTor(tp.appDirectory, tp.bundeledTorPath, tp.controlPort, tp.authenticator)
if err == nil {
// we need to reassign tor, dialer and callback which will have changed by swapping out
// the underlying connection.
tp.t = newTp.t
tp.dialer = newTp.dialer
tp.statusCallback = statusCallback
tp.lastRestartTime = time.Now()
go tp.monitorRestart()