diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Network/BitTorrent/DHT/Query.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Network/BitTorrent/DHT/Query.hs b/src/Network/BitTorrent/DHT/Query.hs index 39ef9604..5345f8b1 100644 --- a/src/Network/BitTorrent/DHT/Query.hs +++ b/src/Network/BitTorrent/DHT/Query.hs | |||
@@ -209,13 +209,17 @@ ioFindNode ih = do | |||
209 | isearch :: (Ord r, Ord ip) => | 209 | isearch :: (Ord r, Ord ip) => |
210 | (InfoHash -> DHT ip (NodeInfo ip -> IO ([NodeInfo ip], [r]))) | 210 | (InfoHash -> DHT ip (NodeInfo ip -> IO ([NodeInfo ip], [r]))) |
211 | -> InfoHash | 211 | -> InfoHash |
212 | -> DHT ip (Set r) | 212 | -> DHT ip (ThreadId, Search.IterativeSearch ip r) |
213 | isearch f ih = do | 213 | isearch f ih = do |
214 | qry <- f ih | 214 | qry <- f ih |
215 | ns <- kclosest 8 ih <$> getTable | 215 | ns <- kclosest 8 ih <$> getTable |
216 | liftIO $ do s <- Search.newSearch qry (toNodeId ih) ns | 216 | liftIO $ do s <- Search.newSearch qry (toNodeId ih) ns |
217 | Search.search s | 217 | a <- fork $ do |
218 | atomically $ readTVar (Search.searchResults s) | 218 | tid <- myThreadId |
219 | labelThread tid ("search."++show ih) | ||
220 | Search.search s | ||
221 | -- atomically $ readTVar (Search.searchResults s) | ||
222 | return (a, s) | ||
219 | 223 | ||
220 | 224 | ||
221 | type Search ip o = Conduit [NodeInfo ip] (DHT ip) [o ip] | 225 | type Search ip o = Conduit [NodeInfo ip] (DHT ip) [o ip] |