deal with conduit 1.3 change

I don't know if this will build with older conduit, it may need an
ifdef.
This commit is contained in:
Joey Hess 2018-04-22 13:14:55 -04:00
parent 8ccbafa917
commit 558a0a9328
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -326,10 +326,10 @@ download meterupdate url file uo = go `catchNonAsync` (const $ return False)
-
- Note that the responseStatus is not checked by this function.
-}
sinkResponseFile :: MonadResource m => MeterUpdate -> BytesProcessed -> FilePath -> IOMode -> Response (ResumableSource m B8.ByteString) -> m ()
sinkResponseFile :: MonadResource m => MeterUpdate -> BytesProcessed -> FilePath -> IOMode -> Response (ConduitM () B8.ByteString m ()) -> m ()
sinkResponseFile meterupdate initialp file mode resp = do
(fr, fh) <- allocate (openBinaryFile file mode) hClose
responseBody resp $$+- go initialp fh
runConduit $ responseBody resp .| go initialp fh
release fr
where
go sofar fh = await >>= \case