, RecordWildCards
, UnicodeSyntax
#-}
-{-# OPTIONS_HADDOCK prune #-}
-- |This is the Resource Monad; monadic actions to define the behavior
-- of each resources. The 'Resource' Monad is a kind of 'Prelude.IO'
-- * Types
Resource
, FormData(..)
- , runRes -- private
+ , runRes
-- * Actions
method ← getMethod
when (method ≡ GET ∨ method ≡ HEAD)
- $ setHeader' "ETag" (printETag tag)
+ $ setHeader' "ETag"
+ $ A.fromAsciiBuilder
+ $ printETag tag
when (method ≡ POST)
$ abort InternalServerError []
(Just "Illegal computation of foundETag for POST request.")
$ fail ("inputLBS: limit must be positive: " ⧺ show actualLimit)
-- Reader にリクエスト
liftIO $ atomically
- $ writeTVar itrReqBodyWanted (Just actualLimit)
+ $ writeTVar itrReqBodyWanted actualLimit
-- 應答を待つ。トランザクションを分けなければ當然デッドロックする。
chunk ← liftIO $ atomically
$ do chunkLen ← readTVar itrReceivedBodyLen
$ fail ("inputChunkLBS: limit must be positive: " ++ show actualLimit)
-- Reader にリクエスト
liftIO $ atomically
- $ writeTVar itrReqBodyWanted (Just actualLimit)
+ $ writeTVar itrReqBodyWanted actualLimit
-- 應答を待つ。トランザクションを分けなければ當然デッドロック。
chunk ← liftIO $ atomically
$ do chunkLen ← readTVar itrReceivedBodyLen