From c0284a86b4982af2249530190326af4cecfc6d3e Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Fri, 21 Feb 2014 22:52:41 +0400 Subject: Do not allow to abort transaction finalization --- src/Network/BitTorrent/Tracker/RPC/UDP.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Network/BitTorrent/Tracker') diff --git a/src/Network/BitTorrent/Tracker/RPC/UDP.hs b/src/Network/BitTorrent/Tracker/RPC/UDP.hs index 499b6d37..6bd22787 100644 --- a/src/Network/BitTorrent/Tracker/RPC/UDP.hs +++ b/src/Network/BitTorrent/Tracker/RPC/UDP.hs @@ -377,7 +377,7 @@ allocTransaction Manager {..} addr ares = modifyMVar pendingResps bindId commitTransaction :: Manager -> SockAddr -> TransactionId -> Response -> IO () commitTransaction Manager {..} addr tid resp = - modifyMVar_ pendingResps $ \ m -> do + modifyMVarMasked_ pendingResps $ \ m -> do case M.lookup tid =<< M.lookup addr m of Nothing -> return m -- tracker responded after 'cancelTransaction' fired Just ares -> do @@ -392,7 +392,7 @@ commitTransaction Manager {..} addr tid resp = cancelTransaction :: Manager -> SockAddr -> TransactionId -> IO () cancelTransaction Manager {..} addr tid = - modifyMVar_ pendingResps $ \m -> + modifyMVarMasked_ pendingResps $ \m -> return $ M.update deleteId addr m where deleteId m -- cgit v1.2.3