]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Resource.hs
many changes
[Lucu.git] / Network / HTTP / Lucu / Resource.hs
index 0caf6ceb7dbf6479e8dfa4141609872f0381e945..c8ca45d00579daff37db145dc98b217ab1f1a3d9 100644 (file)
@@ -652,7 +652,8 @@ input limit
                             -- 成功。itr 内にチャンクを置いたままにする
                             -- とメモリの無駄になるので除去。
                             chunk ← readItr itrReceivedBody seqToLBS itr
-                            writeItr itrReceivedBody (∅) itr
+                            writeItr itrReceivedBody    (∅) itr
+                            writeItr itrReceivedBodyLen 0   itr
                             return chunk
 
                driftTo DecidingHeader
@@ -715,7 +716,8 @@ inputChunk limit
                                          $ retry
                             -- 成功
                             chunk ← readItr itrReceivedBody seqToLBS itr
-                            writeItr itrReceivedBody (∅) itr
+                            writeItr itrReceivedBody    (∅) itr
+                            writeItr itrReceivedBodyLen 0   itr
                             return chunk
                when (Lazy.null chunk)
                    $ driftTo DecidingHeader
@@ -911,7 +913,7 @@ outputChunk wholeChunk
 
          unless (Lazy.null wholeChunk)
              $ liftIO $ atomically $
-               writeItr itrBodyIsNull False itr
+               writeItr itrSentNoBody False itr
     where
       sendChunks ∷ Lazy.ByteString → Int → Resource ()
       sendChunks str limit
@@ -975,7 +977,7 @@ driftTo newState
           = postprocess itr
 
       drift itr _ Done
-          = do bodyIsNull ← readItr itrBodyIsNull id itr
+          = do bodyIsNull ← readItr itrSentNoBody id itr
                when bodyIsNull
                         $ writeDefaultPage itr