diff options
author | jim@bo <jim@bo> | 2018-06-20 22:40:37 -0400 |
---|---|---|
committer | jim@bo <jim@bo> | 2018-06-20 22:43:47 -0400 |
commit | 825962518c6ad00279fc23e8e1dec746980e483f (patch) | |
tree | 68c135bdffd879835c48cce3d397e8edf99b53f4 /src/Network/Tox/Onion | |
parent | 09aa079fbab069f177e08b5239bf684d312eb00a (diff) |
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
Diffstat (limited to 'src/Network/Tox/Onion')
-rw-r--r-- | src/Network/Tox/Onion/Transport.hs | 12 |
1 files changed, 6 insertions, 6 deletions
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) = | |||
246 | , nodeAddr ni ) | 246 | , nodeAddr ni ) |
247 | encodeOnionAddr crypto getRoute (msg,OnionDestination x ni Nothing) = do | 247 | encodeOnionAddr crypto getRoute (msg,OnionDestination x ni Nothing) = do |
248 | encodeOnionAddr crypto getRoute (msg,OnionDestination x ni (Just $ routeId $ nodeId ni) ) | 248 | encodeOnionAddr crypto getRoute (msg,OnionDestination x ni (Just $ routeId $ nodeId ni) ) |
249 | -- hPutStrLn stderr $ "ONION encode missing routeid" | 249 | -- dput XMisc $ "ONION encode missing routeid" |
250 | -- return Nothing | 250 | -- return Nothing |
251 | encodeOnionAddr crypto getRoute (msg,OnionDestination _ ni (Just rid)) = do | 251 | encodeOnionAddr crypto getRoute (msg,OnionDestination _ ni (Just rid)) = do |
252 | let go route = do | 252 | let go route = do |
@@ -255,8 +255,8 @@ encodeOnionAddr crypto getRoute (msg,OnionDestination _ ni (Just rid)) = do | |||
255 | , nodeAddr $ routeNodeA route) | 255 | , nodeAddr $ routeNodeA route) |
256 | mapM' f x = do | 256 | mapM' f x = do |
257 | let _ = x :: Maybe OnionRoute | 257 | let _ = x :: Maybe OnionRoute |
258 | -- hPutStrLn stderr $ "ONION encode sending to " ++ show ni | 258 | -- dput XMisc $ "ONION encode sending to " ++ show ni |
259 | -- hPutStrLn stderr $ "ONION encode getRoute -> " ++ show (fmap (\y -> map ($ y) [routeNodeA,routeNodeB,routeNodeC]) x) | 259 | -- dput XMisc $ "ONION encode getRoute -> " ++ show (fmap (\y -> map ($ y) [routeNodeA,routeNodeB,routeNodeC]) x) |
260 | mapM f x -- ONION encode getRoute -> Nothing | 260 | mapM f x -- ONION encode getRoute -> Nothing |
261 | getRoute ni rid >>= mapM' go | 261 | getRoute ni rid >>= mapM' go |
262 | 262 | ||
@@ -525,7 +525,7 @@ handleOnionResponse proxy crypto saddr udp kont (OnionResponse path msg) = do | |||
525 | Left e -> do | 525 | Left e -> do |
526 | -- todo report encryption error | 526 | -- todo report encryption error |
527 | let n = peanoVal path | 527 | let n = peanoVal path |
528 | hPutStrLn stderr $ unwords [ "peelSymmetric:", show n, either show show (either4or6 saddr), e] | 528 | dput XMisc $ unwords [ "peelSymmetric:", show n, either show show (either4or6 saddr), e] |
529 | kont | 529 | kont |
530 | Right (Addressed dst path') -> do | 530 | Right (Addressed dst path') -> do |
531 | sendMessage udp dst (runPut $ putResponse $ OnionResponse path' msg) | 531 | sendMessage udp dst (runPut $ putResponse $ OnionResponse path' msg) |
@@ -897,9 +897,9 @@ parseDataToRoute crypto (OnionToRouteResponse dta, od) = do | |||
897 | r = either (const $ Right (OnionToRouteResponse dta,od)) Left e | 897 | r = either (const $ Right (OnionToRouteResponse dta,od)) Left e |
898 | -- parseDataToRoute OnionToRouteResponse decipherAndAuth: auth fail | 898 | -- parseDataToRoute OnionToRouteResponse decipherAndAuth: auth fail |
899 | case e of | 899 | case e of |
900 | Left _ -> hPutStrLn stderr $ "Failed keys: " ++ show (map (key2id . snd) ks) | 900 | Left _ -> dput XMisc $ "Failed keys: " ++ show (map (key2id . snd) ks) |
901 | Right _ -> return () | 901 | Right _ -> return () |
902 | hPutStrLn stderr $ unlines | 902 | dput XMisc $ unlines |
903 | [ "parseDataToRoute " ++ either id (const "Right") e | 903 | [ "parseDataToRoute " ++ either id (const "Right") e |
904 | , " crypto inner.me = " ++ either id (\(pk,_,_) -> show $ key2id pk) eInner | 904 | , " crypto inner.me = " ++ either id (\(pk,_,_) -> show $ key2id pk) eInner |
905 | , " inner.them = " ++ either id (show . key2id . dataFromKey) eOuter | 905 | , " inner.them = " ++ either id (show . key2id . dataFromKey) eOuter |