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-server".

The branch, master has been updated
       via  714f050973cfc116da359f7861790bfe4e4129da (commit)
      from  ea532e761de98d5e5cc84718a59b2e70d94da6ff (commit)


Summary of changes:
 src/Snap/Internal/Http/Parser.hs |    7 ++++---
 src/Snap/Internal/Http/Server.hs |    9 ++++-----
 2 files changed, 8 insertions(+), 8 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 714f050973cfc116da359f7861790bfe4e4129da
Author: Gregory Collins <[email protected]>
Date:   Thu Jun 3 23:18:22 2010 -0400

    Re-re-re-re-revert  "unsafe" buffering --- can't make up my mind
    
    This reverts commit ea532e761de98d5e5cc84718a59b2e70d94da6ff.

diff --git a/src/Snap/Internal/Http/Parser.hs b/src/Snap/Internal/Http/Parser.hs
index 9037161..4b3e37d 100644
--- a/src/Snap/Internal/Http/Parser.hs
+++ b/src/Snap/Internal/Http/Parser.hs
@@ -117,14 +117,15 @@ toHex !i' = S.reverse s
 writeChunkedTransferEncoding :: ForeignPtr CChar
                              -> Enumerator IO a
                              -> Enumerator IO a
-writeChunkedTransferEncoding _buf enum it = do
+writeChunkedTransferEncoding buf enum it = do
     killwrap <- newIORef False
-    (out,_)  <- bufferIteratee (ignoreEOF $ wrap killwrap it)
+    --(out,_)  <- bufferIteratee (ignoreEOF $ wrap killwrap it)
+    (out,_)  <- unsafeBufferIterateeWithBuffer buf
+                    (ignoreEOF $ wrap killwrap it)
     i <- enum out
     v <- runIter i (EOF Nothing)
     j <- checkIfDone return v
     writeIORef killwrap True
-    -- w <- runIter j (Chunk (WrapBS "0\r\n\r\n"))
     w <- runIter j (Chunk (WrapBS "0\r\n\r\n"))
     checkIfDone return w
 
diff --git a/src/Snap/Internal/Http/Server.hs b/src/Snap/Internal/Http/Server.hs
index f8bd2f3..f98d74d 100644
--- a/src/Snap/Internal/Http/Server.hs
+++ b/src/Snap/Internal/Http/Server.hs
@@ -271,8 +271,7 @@ runHTTP lh lip lp rip rp alog elog
     logPrefix = S.concat [ "[", rip, "]: error: " ]
 
     go = do
-        --buf <- mkIterateeBuffer
-        buf <- newForeignPtr_ nullPtr
+        buf <- mkIterateeBuffer
         let iter = runServerMonad lh lip lp rip rp (logA alog) (logE elog) $
                                   httpSession writeEnd buf onSendFile tickle
                                   handler
@@ -304,10 +303,10 @@ httpSession :: Iteratee IO ()       -- ^ write end of 
socket
             -> ServerMonad ()
 httpSession writeEnd' ibuf onSendFile tickle handler = do
 
-    -- (writeEnd, cancelBuffering) <-
-    --     liftIO $ I.unsafeBufferIterateeWithBuffer ibuf writeEnd'
+    (writeEnd, cancelBuffering) <-
+        liftIO $ I.unsafeBufferIterateeWithBuffer ibuf writeEnd'
 
-    (writeEnd, cancelBuffering) <- liftIO $ I.bufferIteratee writeEnd'
+    -- (writeEnd, cancelBuffering) <- liftIO $ I.bufferIteratee writeEnd'
     let killBuffer = writeIORef cancelBuffering True
 
 
-----------------------------------------------------------------------


hooks/post-receive
-- 
snap-server
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap

Reply via email to