diff options
author | joe <joe@jerkface.net> | 2017-07-27 22:23:47 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-07-27 22:23:47 -0400 |
commit | 81b49153a856d497a562bc1bb7867d319a26a830 (patch) | |
tree | 4249624e03419b0ffb147e39f5e323aef8c62c66 /src/Network | |
parent | 2590178387d6f5334b35290229d91224c9af3324 (diff) |
Search queries should not catch threadKilled.
Diffstat (limited to 'src/Network')
-rw-r--r-- | src/Network/BitTorrent/DHT/Search.hs | 5 |
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 | |||
19 | import qualified Data.Set as Set | 19 | import qualified Data.Set as Set |
20 | ;import Data.Set (Set) | 20 | ;import Data.Set (Set) |
21 | import System.IO | 21 | import System.IO |
22 | import System.IO.Error | ||
22 | 23 | ||
23 | import qualified Data.MinMaxPSQ as MM | 24 | import 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 () |
115 | sendQuery Search{..} searchTarget searchResult sch@SearchState{..} (ni :-> d) = do | 116 | sendQuery 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 |