diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-12-30 12:31:17 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-12-30 12:31:17 -0400 |
commit | c532deba4a8020a8e777eaa6e205133c8c169c4a (patch) | |
tree | 610568e8eb5fb5661a5c2638d309d1fa13aff746 /Command | |
parent | 7cea120676d0315d8cf318f54aa64bfa621e0d5a (diff) |
refactor
Diffstat (limited to 'Command')
-rw-r--r-- | Command/EnableTor.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Command/EnableTor.hs b/Command/EnableTor.hs index 27e57d649..7af627725 100644 --- a/Command/EnableTor.hs +++ b/Command/EnableTor.hs @@ -12,6 +12,7 @@ module Command.EnableTor where import Command import qualified Annex import P2P.Address +import P2P.Annex import Utility.Tor import Annex.UUID import Config.Files @@ -105,10 +106,8 @@ checkHiddenService = bracket setup cleanup go startlistener = do r <- Annex.gitRepo u <- getUUID - uid <- liftIO getRealUserID - let ident = fromUUID u - v <- liftIO $ getHiddenServiceSocketFile torAppName uid ident - case v of + msock <- torSocketFile + case msock of Just sockfile -> ifM (liftIO $ haslistener sockfile) ( liftIO $ async $ return () , liftIO $ async $ runlistener sockfile u r |