diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/dhtd.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs index 96c31dfe..bc5e9eda 100644 --- a/examples/dhtd.hs +++ b/examples/dhtd.hs | |||
@@ -15,6 +15,7 @@ import Data.Char | |||
15 | import Data.Default | 15 | import Data.Default |
16 | import Data.List as L | 16 | import Data.List as L |
17 | import Data.Maybe | 17 | import Data.Maybe |
18 | import Data.String | ||
18 | import qualified Data.ByteString as B (ByteString,writeFile,readFile) | 19 | import qualified Data.ByteString as B (ByteString,writeFile,readFile) |
19 | ; import Data.ByteString (ByteString) | 20 | ; import Data.ByteString (ByteString) |
20 | import System.IO | 21 | import System.IO |
@@ -140,6 +141,12 @@ clientSession st signalQuit sock n h = do | |||
140 | return $ do | 141 | return $ do |
141 | hPutClient h $ showReport r | 142 | hPutClient h $ showReport r |
142 | 143 | ||
144 | s | "peers " `isPrefixOf` s -> cmd $ do | ||
145 | let ih = fromString (drop 6 s) | ||
146 | ps <- allPeers ih | ||
147 | return $ do | ||
148 | hPutClient h $ showReport $ map (((,) "") . show . pPrint) ps | ||
149 | |||
143 | _ -> cmd0 $ hPutClient h "error." | 150 | _ -> cmd0 $ hPutClient h "error." |
144 | 151 | ||
145 | main :: IO () | 152 | main :: IO () |