git.iko.soy/typeable/servant
on master help sign in
Update reqBodyRef comment.
commitb43301967d20c160ef624129a0b20e596261af22 authorJulian K. Arni <jkarni@gmail.com> dateSun 4 Jan 2015, 16:08 (12 years ago) parent726848b
1 file changed+5−2
src/Servant/Server/Internal.hs+5−2
src/Servant/Server/Internal.hs+5−2
@@ -33,8 +33,11 @@ data ReqBodyState = Uncalled
3333toApplication :: RoutingApplication -> Application
3434toApplication ra request respond = do
3535 reqBodyRef <- newIORef Uncalled
36− -- We need to check the requestBody possibly more than once, so instead
37− -- of consuming it entirely once, we cycle through it.
36+ -- We may need to consume the requestBody more than once. In order to
37+ -- maintain the illusion that 'requestBody' works as expected,
38+ -- 'ReqBodyState' is introduced, and the complete body is memoized and
39+ -- returned as many times as requested with empty "Done" marker chunks in
40+ -- between.
3841 -- See https://github.com/haskell-servant/servant/issues/3
3942 let memoReqBody = do
4043 ior <- readIORef reqBodyRef