summaryrefslogtreecommitdiff
path: root/RemoteDaemon
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-12-09 17:02:21 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-12-09 17:02:59 -0400
commit72a923a50e6ad91d59ebafc178ab562d8488c106 (patch)
treec8d7c8b8b21ab6f7fb70faf7d3e7e04cb2e82804 /RemoteDaemon
parentb20938878096e97cd4bd54df23ebc35b09414b35 (diff)
fix uuid comparison
Diffstat (limited to 'RemoteDaemon')
-rw-r--r--RemoteDaemon/Transport/Tor.hs18
1 files changed, 10 insertions, 8 deletions
diff --git a/RemoteDaemon/Transport/Tor.hs b/RemoteDaemon/Transport/Tor.hs
index 6149df376..220a3616d 100644
--- a/RemoteDaemon/Transport/Tor.hs
+++ b/RemoteDaemon/Transport/Tor.hs
@@ -133,14 +133,16 @@ transport (RemoteRepo r _) url@(RemoteURI uri) th ichan ochan =
res <- runNetProto conn $
P2P.auth myuuid authtoken
case res of
- Right (Just theiruuid)
- | getUncachedUUID r == theiruuid -> do
- send (CONNECTED url)
- status <- handlecontrol
- `race` handlepeer conn
- send (DISCONNECTED url)
- return $ either id id status
- | otherwise -> return ConnectionStopping
+ Right (Just theiruuid) -> do
+ expecteduuid <- liftAnnex th $ getRepoUUID r
+ if expecteduuid == theiruuid
+ then do
+ send (CONNECTED url)
+ status <- handlecontrol
+ `race` handlepeer conn
+ send (DISCONNECTED url)
+ return $ either id id status
+ else return ConnectionStopping
_ -> return ConnectionClosed
send msg = atomically $ writeTChan ochan msg