diff options
author | 2014-11-03 20:36:11 -0400 | |
---|---|---|
committer | 2014-11-03 20:36:11 -0400 | |
commit | 86298d7dac35c4b74aa5bd8ae0b8432caaf3f582 (patch) | |
tree | 127e2f596ec77c69b9e578dab305151921963a1d | |
parent | c973711ffb463d69ac6cdce599832d482986d1da (diff) |
switch from hGetSome to hGet
This should be essentially no-op change for hGetContentsMetered, since it
always gets the entire contents. So the only difference is that each chunk
of the lazy bytestring will always be the full chunk size. So, I'm pretty
sure this is safe. Also, the only current users of hGetContentsMetered are
reading files, so the stream won't block for long in the middle.
The improvement is that hGetUntilMetered will always get some multiple of
the defaultChunkSize. This will allow the S3 multipart code to pick a fixed
size and know that hGetUntilMetered will really get that size.
-rw-r--r-- | Utility/Metered.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Utility/Metered.hs b/Utility/Metered.hs index 447eab2e8..f27eee26d 100644 --- a/Utility/Metered.hs +++ b/Utility/Metered.hs @@ -120,7 +120,7 @@ hGetUntilMetered h keepgoing meterupdate = lazyRead zeroBytesProcessed lazyRead sofar = unsafeInterleaveIO $ loop sofar loop sofar = do - c <- S.hGetSome h defaultChunkSize + c <- S.hGet h defaultChunkSize if S.null c then do hClose h |