Update reqBodyRef comment.

This commit is contained in:
Julian K. Arni 2015-01-04 16:08:22 +01:00
parent 726848b8a3
commit b43301967d

View file

@ -33,8 +33,11 @@ data ReqBodyState = Uncalled
toApplication :: RoutingApplication -> Application toApplication :: RoutingApplication -> Application
toApplication ra request respond = do toApplication ra request respond = do
reqBodyRef <- newIORef Uncalled reqBodyRef <- newIORef Uncalled
-- We need to check the requestBody possibly more than once, so instead -- We may need to consume the requestBody more than once. In order to
-- of consuming it entirely once, we cycle through it. -- maintain the illusion that 'requestBody' works as expected,
-- 'ReqBodyState' is introduced, and the complete body is memoized and
-- returned as many times as requested with empty "Done" marker chunks in
-- between.
-- See https://github.com/haskell-servant/servant/issues/3 -- See https://github.com/haskell-servant/servant/issues/3
let memoReqBody = do let memoReqBody = do
ior <- readIORef reqBodyRef ior <- readIORef reqBodyRef