convert getFileSize to RawFilePath

Lots of nice wins from this in avoiding unncessary work, and I think
nothing got slower.

This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
This commit is contained in:
Joey Hess 2020-11-05 11:26:34 -04:00
parent 2670af9d5a
commit 9b0dde834e
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
34 changed files with 79 additions and 70 deletions

View file

@ -32,7 +32,7 @@ httpStorer a = fileStorer $ \k f m -> a k =<< liftIO (httpBodyStorer f m)
-- the meter as it's sent.
httpBodyStorer :: FilePath -> MeterUpdate -> IO RequestBody
httpBodyStorer src m = do
size <- getFileSize src
size <- getFileSize (toRawFilePath src)
let streamer sink = withMeteredFile src m $ \b -> byteStringPopper b sink
return $ RequestBodyStream (fromInteger size) streamer