summaryrefslogtreecommitdiff
path: root/dht/examples/dhtd.hs
diff options
context:
space:
mode:
Diffstat (limited to 'dht/examples/dhtd.hs')
-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