This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "snap-core".
The branch, master has been updated
via 46311d3eaa4925d36875ea2dbd570d8b4d3e9597 (commit)
from c5f3d2131b71437a891843646372a8a5de058927 (commit)
Summary of changes:
src/Snap/Iteratee.hs | 24 ++++--------------------
1 files changed, 4 insertions(+), 20 deletions(-)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 46311d3eaa4925d36875ea2dbd570d8b4d3e9597
Author: Gregory Collins <[email protected]>
Date: Tue Aug 31 17:38:11 2010 -0400
Remove 'escape valve' from buffer funcs
diff --git a/src/Snap/Iteratee.hs b/src/Snap/Iteratee.hs
index ac15c39..2caf633 100644
--- a/src/Snap/Iteratee.hs
+++ b/src/Snap/Iteratee.hs
@@ -71,7 +71,6 @@ import "monads-fd" Control.Monad.Trans (liftIO)
import Control.Exception (SomeException)
import System.IO.Posix.MMap
import System.PosixCompat.Files
-import System.Posix.Types
#endif
------------------------------------------------------------------------------
@@ -195,11 +194,7 @@ mkIterateeBuffer = mallocPlainForeignPtrBytes bUFSIZ
-- socket) it'll get changed out from underneath you, breaking referential
-- transparency. Use with caution!
--
--- The IORef returned can be set to True to "cancel" buffering. We added this
--- so that transfer-encoding: chunked (which needs its own buffer and therefore
--- doesn't need /its/ output buffered) can switch the outer buffer off.
---
-unsafeBufferIteratee :: Iteratee IO a -> IO (Iteratee IO a, IORef Bool)
+unsafeBufferIteratee :: Iteratee IO a -> IO (Iteratee IO a)
unsafeBufferIteratee iter = do
buf <- mkIterateeBuffer
unsafeBufferIterateeWithBuffer buf iter
@@ -214,29 +209,18 @@ unsafeBufferIteratee iter = do
--
-- This version accepts a buffer created by 'mkIterateeBuffer'.
--
--- The IORef returned can be set to True to "cancel" buffering. We added this
--- so that transfer-encoding: chunked (which needs its own buffer and therefore
--- doesn't need /its/ output buffered) can switch the outer buffer off.
---
unsafeBufferIterateeWithBuffer :: ForeignPtr CChar
-> Iteratee IO a
- -> IO (Iteratee IO a, IORef Bool)
+ -> IO (Iteratee IO a)
unsafeBufferIterateeWithBuffer buf iteratee = do
- esc <- newIORef False
- return $! (start esc iteratee, esc)
+ return $! start iteratee
where
- start esc iter = IterateeG $! checkRef esc iter
+ start iter = IterateeG $! f 0 iter
go bytesSoFar iter =
{-# SCC "unsafeBufferIteratee/go" #-}
IterateeG $! f bytesSoFar iter
- checkRef esc iter ch = do
- quit <- readIORef esc
- if quit
- then runIter iter ch
- else f 0 iter ch
-
sendBuf n iter =
{-# SCC "unsafeBufferIteratee/sendBuf" #-}
withForeignPtr buf $ \ptr -> do
-----------------------------------------------------------------------
hooks/post-receive
--
snap-core
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap