summaryrefslogtreecommitdiff
path: root/src/Network
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-07-27 22:23:47 -0400
committerjoe <joe@jerkface.net>2017-07-27 22:23:47 -0400
commit81b49153a856d497a562bc1bb7867d319a26a830 (patch)
tree4249624e03419b0ffb147e39f5e323aef8c62c66 /src/Network
parent2590178387d6f5334b35290229d91224c9af3324 (diff)
Search queries should not catch threadKilled.
Diffstat (limited to 'src/Network')
-rw-r--r--src/Network/BitTorrent/DHT/Search.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Network/BitTorrent/DHT/Search.hs b/src/Network/BitTorrent/DHT/Search.hs
index b263e339..51b40b2c 100644
--- a/src/Network/BitTorrent/DHT/Search.hs
+++ b/src/Network/BitTorrent/DHT/Search.hs
@@ -19,6 +19,7 @@ import Data.Maybe
19import qualified Data.Set as Set 19import qualified Data.Set as Set
20 ;import Data.Set (Set) 20 ;import Data.Set (Set)
21import System.IO 21import System.IO
22import System.IO.Error
22 23
23import qualified Data.MinMaxPSQ as MM 24import qualified Data.MinMaxPSQ as MM
24 ;import Data.MinMaxPSQ (MinMaxPSQ, MinMaxPSQ') 25 ;import Data.MinMaxPSQ (MinMaxPSQ, MinMaxPSQ')
@@ -114,9 +115,7 @@ sendQuery :: forall addr nid tok ni r.
114 -> IO () 115 -> IO ()
115sendQuery Search{..} searchTarget searchResult sch@SearchState{..} (ni :-> d) = do 116sendQuery Search{..} searchTarget searchResult sch@SearchState{..} (ni :-> d) = do
116 myThreadId >>= flip labelThread ("searchQuery." ++ show searchTarget) 117 myThreadId >>= flip labelThread ("searchQuery." ++ show searchTarget)
117 -- TODO: Should we really be catching ThreadKilled ? 118 reply <- searchQuery searchTarget ni `catchIOError` const (return Nothing)
118 reply <- handle (\(SomeException e) -> return Nothing)
119 (searchQuery searchTarget ni)
120 -- (ns,rs) 119 -- (ns,rs)
121 let tok = error "TODO: token" 120 let tok = error "TODO: token"
122 atomically $ do 121 atomically $ do