fix alterTransferInfo

don't want to stomp over fields other than the ones being changed
This commit is contained in:
Joey Hess 2012-08-31 12:14:16 -04:00
parent 34aeecb78a
commit 4004baafaf
3 changed files with 10 additions and 16 deletions

View file

@ -192,9 +192,8 @@ adjustTransfersSTM dstatus a = do
putTMVar dstatus $ s { currentTransfers = a (currentTransfers s) }
{- Alters a transfer's info, if the transfer is in the map. -}
alterTransferInfo :: DaemonStatusHandle -> Transfer -> TransferInfo -> IO ()
alterTransferInfo dstatus t info = updateTransferInfo' dstatus $
M.adjust (const info) t
alterTransferInfo :: DaemonStatusHandle -> Transfer -> (TransferInfo -> TransferInfo) -> IO ()
alterTransferInfo dstatus t a = updateTransferInfo' dstatus $ M.adjust a t
{- Updates a transfer's info. Adds the transfer to the map if necessary,
- or if already present, updates it while preserving the old transferTid