diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-21 22:52:41 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-21 22:52:41 +0400 |
commit | c0284a86b4982af2249530190326af4cecfc6d3e (patch) | |
tree | 591ea76ece706262bf0f2c7b2f2a5fd211203452 /src/Network/BitTorrent/Tracker/RPC | |
parent | 7be32f085a25f847b6eb07a085b4db8b3d3f6da3 (diff) |
Do not allow to abort transaction finalization
Diffstat (limited to 'src/Network/BitTorrent/Tracker/RPC')
-rw-r--r-- | src/Network/BitTorrent/Tracker/RPC/UDP.hs | 4 |
1 files changed, 2 insertions, 2 deletions
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 | |||
377 | 377 | ||
378 | commitTransaction :: Manager -> SockAddr -> TransactionId -> Response -> IO () | 378 | commitTransaction :: Manager -> SockAddr -> TransactionId -> Response -> IO () |
379 | commitTransaction Manager {..} addr tid resp = | 379 | commitTransaction Manager {..} addr tid resp = |
380 | modifyMVar_ pendingResps $ \ m -> do | 380 | modifyMVarMasked_ pendingResps $ \ m -> do |
381 | case M.lookup tid =<< M.lookup addr m of | 381 | case M.lookup tid =<< M.lookup addr m of |
382 | Nothing -> return m -- tracker responded after 'cancelTransaction' fired | 382 | Nothing -> return m -- tracker responded after 'cancelTransaction' fired |
383 | Just ares -> do | 383 | Just ares -> do |
@@ -392,7 +392,7 @@ commitTransaction Manager {..} addr tid resp = | |||
392 | 392 | ||
393 | cancelTransaction :: Manager -> SockAddr -> TransactionId -> IO () | 393 | cancelTransaction :: Manager -> SockAddr -> TransactionId -> IO () |
394 | cancelTransaction Manager {..} addr tid = | 394 | cancelTransaction Manager {..} addr tid = |
395 | modifyMVar_ pendingResps $ \m -> | 395 | modifyMVarMasked_ pendingResps $ \m -> |
396 | return $ M.update deleteId addr m | 396 | return $ M.update deleteId addr m |
397 | where | 397 | where |
398 | deleteId m | 398 | deleteId m |