debug on error serving peer
authorJoey Hess <joeyh@joeyh.name>
Fri, 9 Dec 2016 17:00:19 +0000 (13:00 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 9 Dec 2016 17:00:19 +0000 (13:00 -0400)
RemoteDaemon/Transport/Tor.hs

index 7afc9c33334fb61e8bc66a6e88f59f968676f393..0dd1d1ba2763f4a5791801c695a70ca8f0896aec 100644 (file)
@@ -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"