diff options
Diffstat (limited to 'dht/examples/dhtd.hs')
-rw-r--r-- | dht/examples/dhtd.hs | 9 |
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 = "*" | |||
355 | showPolicy OpenToConnect = "o" | 355 | showPolicy OpenToConnect = "o" |
356 | showPolicy RefusingToConnect = "x" | 356 | showPolicy RefusingToConnect = "x" |
357 | 357 | ||
358 | waitOn :: (nid -> ni -> (result -> IO ()) -> IO ()) | ||
359 | -> nid -> ni -> IO result | ||
360 | waitOn bg nid ni = do | ||
361 | mvar <- newEmptyMVar | ||
362 | bg nid ni $ putMVar mvar | ||
363 | takeMVar mvar | ||
364 | |||
365 | getSessions :: TVar (Map.Map Uniq24 AggregateSession) -> Uniq24 -> STM [Tox.Session] | 358 | getSessions :: TVar (Map.Map Uniq24 AggregateSession) -> Uniq24 -> STM [Tox.Session] |
366 | getSessions ssvar u24 = do | 359 | getSessions 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 |