From e404526c86e1a4662e73746b3b938b5f07efdce5 Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Tue, 28 Jan 2020 15:42:42 -0500 Subject: Command to view individual onion route. --- dht/examples/dhtd.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 tcpm <- requestTCPMode onionRouter (Just True) hPutClient h $ "Onion routes: " ++ if tcpm then "TCP." else "UDP." + ("o", s) | n <- strp $ map toLower s + , all isDigit n + -> cmd0 $ do + case Tox.RouteId <$> readMaybe n of + Just r -> do + monion <- lookupRoute onionRouter (error "lookupRoute used NodeInfo argument!") r + case monion of + Nothing -> hPutClient h $ "No route yet for " ++ show r + Just onion -> hPutClient h $ unlines $ showRoute " " onion + Nothing -> hPutClient h "syntax error." ("g", s) | Just DHT{..} <- Map.lookup netname dhts -> cmd0 $ do -- arguments: method -- cgit v1.2.3