@@ -12,12 +12,12 @@ requestBodyHandle :: Handle -> Int -> Source
1212requestBodyHandle h =
1313 requestBodyFunc go
1414 where
15− go = Just `fmap` B.hGet h defaultChunkSize
15+ go i = Just `fmap` B.hGet h (min i defaultChunkSize)
1616
17−requestBodyFunc :: IO (Maybe B.ByteString) -> Int -> Source
17+requestBodyFunc :: (Int -> IO (Maybe B.ByteString)) -> Int -> Source
1818requestBodyFunc _ 0 = Source $ return Nothing
1919requestBodyFunc h len = Source $ do
20− mbs <- h
20+ mbs <- h len
2121 case mbs of
2222 Nothing -> return Nothing
2323 Just bs -> do