summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/dhtd.hs7
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
15import Data.Default 15import Data.Default
16import Data.List as L 16import Data.List as L
17import Data.Maybe 17import Data.Maybe
18import Data.String
18import qualified Data.ByteString as B (ByteString,writeFile,readFile) 19import qualified Data.ByteString as B (ByteString,writeFile,readFile)
19 ; import Data.ByteString (ByteString) 20 ; import Data.ByteString (ByteString)
20import System.IO 21import 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
145main :: IO () 152main :: IO ()