-- 成功。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
unless (Lazy.null wholeChunk)
$ liftIO $ atomically $
- writeItr itrBodyIsNull False itr
+ writeItr itrSentNoBody False itr
where
sendChunks ∷ Lazy.ByteString → Int → Resource ()
sendChunks str limit
= postprocess itr
drift itr _ Done
- = do bodyIsNull ← readItr itrBodyIsNull id itr
+ = do bodyIsNull ← readItr itrSentNoBody id itr
when bodyIsNull
$ writeDefaultPage itr