, mkDefaultPage
)
where
-import qualified Blaze.ByteString.Builder.ByteString as BB
+import qualified Blaze.ByteString.Builder.Char.Utf8 as BB
import Control.Arrow
import Control.Arrow.ArrowList
import Control.Arrow.ListArrow
import Data.Maybe
import qualified Data.Text as T
import qualified Data.Text.Lazy as Lazy
-import qualified Data.Text.Lazy.Encoding as Lazy
import Network.HTTP.Lucu.Config
import Network.HTTP.Lucu.Headers
import Network.HTTP.Lucu.Interaction
let conf = itrConfig itr
page = getDefaultPage conf reqM res
- putTMVar (itrBodyToSend itr)
- (BB.fromLazyByteString $ Lazy.encodeUtf8 page)
+ putTMVar (itrBodyToSend itr) (BB.fromLazyText page)
mkDefaultPage ∷ (ArrowXml a) ⇒ Config → StatusCode → a b XmlTree → a b XmlTree
{-# INLINEABLE mkDefaultPage #-}
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.ICU.Convert as TC
-import Data.Text.ICU.Error
import Data.Text.Encoding
+import Data.Text.ICU.Error
import Data.Traversable
import Data.Word
import Network.HTTP.Lucu.Parser.Http
-- 成功。itr 内にチャンクを置いたままにする
-- とメモリの無駄になるので除去。
chunk ← readItr itrReceivedBody seqToLBS itr
- writeItr itrReceivedBody (∅) itr
+ writeItr itrReceivedBody (∅) itr
+ writeItr itrReceivedBodyLen 0 itr
return chunk
driftTo DecidingHeader
$ retry
-- 成功
chunk ← readItr itrReceivedBody seqToLBS itr
- writeItr itrReceivedBody (∅) itr
+ writeItr itrReceivedBody (∅) itr
+ writeItr itrReceivedBodyLen 0 itr
return chunk
when (Lazy.null chunk)
$ driftTo DecidingHeader