From 725b8a5e14b5c2161f982d6e1b7d06f6952d56c1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 9 Dec 2016 17:02:21 -0400 Subject: [PATCH] fix uuid comparison --- RemoteDaemon/Transport/Tor.hs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/RemoteDaemon/Transport/Tor.hs b/RemoteDaemon/Transport/Tor.hs index 6149df3767..220a3616d2 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