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.hs9
1 files changed, 1 insertions, 8 deletions
diff --git a/dht/examples/dhtd.hs b/dht/examples/dhtd.hs
index 71be24eb..ef3f6bd4 100644
--- a/dht/examples/dhtd.hs
+++ b/dht/examples/dhtd.hs
@@ -355,13 +355,6 @@ showPolicy TryingToConnect = "*"
355showPolicy OpenToConnect = "o" 355showPolicy OpenToConnect = "o"
356showPolicy RefusingToConnect = "x" 356showPolicy RefusingToConnect = "x"
357 357
358waitOn :: (nid -> ni -> (result -> IO ()) -> IO ())
359 -> nid -> ni -> IO result
360waitOn bg nid ni = do
361 mvar <- newEmptyMVar
362 bg nid ni $ putMVar mvar
363 takeMVar mvar
364
365getSessions :: TVar (Map.Map Uniq24 AggregateSession) -> Uniq24 -> STM [Tox.Session] 358getSessions :: TVar (Map.Map Uniq24 AggregateSession) -> Uniq24 -> STM [Tox.Session]
366getSessions ssvar u24 = do 359getSessions ssvar u24 = do
367 agmap <- readTVar ssvar 360 agmap <- readTVar ssvar
@@ -788,7 +781,7 @@ clientSession s@Session{..} sock cnum h = do
788 go | null destination = fmap Right . qhandler self 781 go | null destination = fmap Right . qhandler self
789 | otherwise = case readEither destination of 782 | otherwise = case readEither destination of
790 Right ni -> fmap (maybe (Left "Timeout.") Right) 783 Right ni -> fmap (maybe (Left "Timeout.") Right)
791 . flip (either id waitOn $ searchQuery qsearch) ni 784 . flip (searchQuery qsearch) ni
792 Left e -> const $ return $ Left ("Bad destination: "++e) 785 Left e -> const $ return $ Left ("Bad destination: "++e)
793 maybe (hPutClient h ("Unsupported method: "++method)) 786 maybe (hPutClient h ("Unsupported method: "++method))
794 goQuery 787 goQuery