This commit is contained in:
Joey Hess 2016-12-30 12:31:17 -04:00
parent dfbd303d66
commit b219be5100
No known key found for this signature in database
GPG key ID: C910D9222512E3C7
3 changed files with 19 additions and 10 deletions

View file

@ -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