summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2020-01-28 15:42:42 -0500
committerJoe Crayne <joe@jerkface.net>2020-01-28 17:26:25 -0500
commite404526c86e1a4662e73746b3b938b5f07efdce5 (patch)
treea5d2fb3e4f9c5e29728f65a452813b598f88476b
parent492ecf32827ca43d91046c863cd9c34e2ce3dfb4 (diff)
Command to view individual onion route.
-rw-r--r--dht/examples/dhtd.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/dht/examples/dhtd.hs b/dht/examples/dhtd.hs
index eb31543a..761b7140 100644
--- a/dht/examples/dhtd.hs
+++ b/dht/examples/dhtd.hs
@@ -796,6 +796,16 @@ clientSession s@Session{..} sock cnum h = do
796 tcpm <- requestTCPMode onionRouter (Just True) 796 tcpm <- requestTCPMode onionRouter (Just True)
797 hPutClient h $ "Onion routes: " ++ if tcpm then "TCP." else "UDP." 797 hPutClient h $ "Onion routes: " ++ if tcpm then "TCP." else "UDP."
798 798
799 ("o", s) | n <- strp $ map toLower s
800 , all isDigit n
801 -> cmd0 $ do
802 case Tox.RouteId <$> readMaybe n of
803 Just r -> do
804 monion <- lookupRoute onionRouter (error "lookupRoute used NodeInfo argument!") r
805 case monion of
806 Nothing -> hPutClient h $ "No route yet for " ++ show r
807 Just onion -> hPutClient h $ unlines $ showRoute " " onion
808 Nothing -> hPutClient h "syntax error."
799 ("g", s) | Just DHT{..} <- Map.lookup netname dhts 809 ("g", s) | Just DHT{..} <- Map.lookup netname dhts
800 -> cmd0 $ do 810 -> cmd0 $ do
801 -- arguments: method 811 -- arguments: method