From 3d759a03224951fbaabd38ebbbf476db320e7eb1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 9 Dec 2016 13:00:19 -0400 Subject: [PATCH] debug on error serving peer --- RemoteDaemon/Transport/Tor.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/RemoteDaemon/Transport/Tor.hs b/RemoteDaemon/Transport/Tor.hs index 7afc9c3333..0dd1d1ba27 100644 --- a/RemoteDaemon/Transport/Tor.hs +++ b/RemoteDaemon/Transport/Tor.hs @@ -92,13 +92,16 @@ serveClient th u r q = bracket setup cleanup go } v <- liftIO $ runNetProto conn $ serveAuth u case v of - Right (Just theiruuid) -> void $ - runFullProto (Serving theiruuid) conn $ + Right (Just theiruuid) -> void $ do + v' <- runFullProto (Serving theiruuid) conn $ serveAuthed u + case v' of + Right () -> return () + Left e -> liftIO $ debugM "remotedaemon" ("Tor connection error: " ++ e) Right Nothing -> liftIO $ debugM "remotedaemon" "Tor connection failed to authenticate" Left e -> liftIO $ - debugM "remotedaemon" ("Error while serving Tor connection: " ++ e) + debugM "remotedaemon" ("Tor connection error before authentication: " ++ e) -- Merge the duplicated state back in. liftAnnex th $ mergeState st' debugM "remotedaemon" "done with Tor connection"