From 825962518c6ad00279fc23e8e1dec746980e483f Mon Sep 17 00:00:00 2001 From: "jim@bo" Date: Wed, 20 Jun 2018 22:40:37 -0400 Subject: More DPut stuff * verbose/quiet without args shows report * verbose all - sets all tags verbose * quiet all - sets all tags quiet * XMisc defaults to verbose, everything else quiet * new XMan tag for ToxManager related stuff * s/hputStrLn stderr/dput XMisc/ in daemon code --- src/Network/Tox/Onion/Transport.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Network/Tox/Onion') diff --git a/src/Network/Tox/Onion/Transport.hs b/src/Network/Tox/Onion/Transport.hs index 8a66f2b2..70714465 100644 --- a/src/Network/Tox/Onion/Transport.hs +++ b/src/Network/Tox/Onion/Transport.hs @@ -246,7 +246,7 @@ encodeOnionAddr crypto _ (msg,OnionToOwner ni p) = , nodeAddr ni ) encodeOnionAddr crypto getRoute (msg,OnionDestination x ni Nothing) = do encodeOnionAddr crypto getRoute (msg,OnionDestination x ni (Just $ routeId $ nodeId ni) ) - -- hPutStrLn stderr $ "ONION encode missing routeid" + -- dput XMisc $ "ONION encode missing routeid" -- return Nothing encodeOnionAddr crypto getRoute (msg,OnionDestination _ ni (Just rid)) = do let go route = do @@ -255,8 +255,8 @@ encodeOnionAddr crypto getRoute (msg,OnionDestination _ ni (Just rid)) = do , nodeAddr $ routeNodeA route) mapM' f x = do let _ = x :: Maybe OnionRoute - -- hPutStrLn stderr $ "ONION encode sending to " ++ show ni - -- hPutStrLn stderr $ "ONION encode getRoute -> " ++ show (fmap (\y -> map ($ y) [routeNodeA,routeNodeB,routeNodeC]) x) + -- dput XMisc $ "ONION encode sending to " ++ show ni + -- dput XMisc $ "ONION encode getRoute -> " ++ show (fmap (\y -> map ($ y) [routeNodeA,routeNodeB,routeNodeC]) x) mapM f x -- ONION encode getRoute -> Nothing getRoute ni rid >>= mapM' go @@ -525,7 +525,7 @@ handleOnionResponse proxy crypto saddr udp kont (OnionResponse path msg) = do Left e -> do -- todo report encryption error let n = peanoVal path - hPutStrLn stderr $ unwords [ "peelSymmetric:", show n, either show show (either4or6 saddr), e] + dput XMisc $ unwords [ "peelSymmetric:", show n, either show show (either4or6 saddr), e] kont Right (Addressed dst path') -> do sendMessage udp dst (runPut $ putResponse $ OnionResponse path' msg) @@ -897,9 +897,9 @@ parseDataToRoute crypto (OnionToRouteResponse dta, od) = do 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) + Left _ -> dput XMisc $ "Failed keys: " ++ show (map (key2id . snd) ks) Right _ -> return () - hPutStrLn stderr $ unlines + dput XMisc $ unlines [ "parseDataToRoute " ++ either id (const "Right") e , " crypto inner.me = " ++ either id (\(pk,_,_) -> show $ key2id pk) eInner , " inner.them = " ++ either id (show . key2id . dataFromKey) eOuter -- cgit v1.2.3