logic error

This commit is contained in:
Joey Hess 2014-11-03 20:15:33 -04:00
parent 62de9a39bf
commit 4230b56b79

View file

@ -20,7 +20,7 @@ import qualified Data.ByteString as S
import qualified Data.Map as M import qualified Data.Map as M
import Data.Char import Data.Char
import Network.Socket (HostName) import Network.Socket (HostName)
import Network.HTTP.Conduit (Manager, newManager, closeManager, withManager) import Network.HTTP.Conduit (Manager, newManager, closeManager)
import Network.HTTP.Client (defaultManagerSettings, managerResponseTimeout, responseStatus, responseBody, RequestBody(..)) import Network.HTTP.Client (defaultManagerSettings, managerResponseTimeout, responseStatus, responseBody, RequestBody(..))
import Network.HTTP.Types import Network.HTTP.Types
import Control.Monad.Trans.Resource import Control.Monad.Trans.Resource
@ -184,7 +184,7 @@ store r h = fileStorer $ \k f p -> do
-- Send parts of the file, taking care to stream each part -- Send parts of the file, taking care to stream each part
-- w/o buffering in memory, since the parts can be large. -- w/o buffering in memory, since the parts can be large.
etags <- bracketIO (openBinaryFile f ReadMode) hClose $ \fh -> do etags <- bracketIO (openBinaryFile f ReadMode) hClose $ \fh -> do
let sendparts meter etags partnum = ifM (liftIO $ hIsOpen fh) let sendparts meter etags partnum = ifM (liftIO $ hIsClosed fh)
( return (reverse etags) ( return (reverse etags)
, do , do
b <- liftIO $ hGetUntilMetered fh (< partsz) meter b <- liftIO $ hGetUntilMetered fh (< partsz) meter