From e27ad4390a27011b9cec04769e92020089e8c302 Mon Sep 17 00:00:00 2001 From: joe Date: Sun, 10 Jun 2018 02:21:13 -0400 Subject: Tox: improved data-to-route and onion debug prints. --- src/Network/Tox/Onion/Transport.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/Network/Tox/Onion') diff --git a/src/Network/Tox/Onion/Transport.hs b/src/Network/Tox/Onion/Transport.hs index d604a5c8..864e831f 100644 --- a/src/Network/Tox/Onion/Transport.hs +++ b/src/Network/Tox/Onion/Transport.hs @@ -891,12 +891,15 @@ parseDataToRoute crypto (OnionToRouteResponse dta, od) = do $ Rendezvous (rendezvousPublic crypto) $ onionNodeInfo od ) r = either (const $ Right (OnionToRouteResponse dta,od)) Left e -- parseDataToRoute OnionToRouteResponse decipherAndAuth: auth fail + case e of + Left _ -> hPutStrLn stderr $ "Failed keys: " ++ show (map (key2id . snd) ks) + Right _ -> return () hPutStrLn stderr $ unlines [ "parseDataToRoute " ++ either id (const "Right") e - , " crypto inner.me =" ++ either id (\(pk,_,_) -> show $ key2id pk) eInner - , " inner.you=" ++ either id (show . key2id . dataFromKey) eOuter - , " outer.me =" ++ show (key2id $ rendezvousPublic crypto) - , " outer.you=" ++ show (key2id $ senderKey dta) + , " crypto inner.me = " ++ either id (\(pk,_,_) -> show $ key2id pk) eInner + , " inner.them = " ++ either id (show . key2id . dataFromKey) eOuter + , " outer.me = " ++ show (key2id $ rendezvousPublic crypto) + , " outer.them = " ++ show (key2id $ senderKey dta) ] return r parseDataToRoute _ msg = return $ Right msg -- cgit v1.2.3