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 ac48b02e999794da054c37ad82e9e89abdfb6eb2 (commit)
from 0f844edaa0f5663302af43d85b48c4b57587e7b3 (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 ac48b02e999794da054c37ad82e9e89abdfb6eb2
Author: Gregory Collins <[email protected]>
Date: Thu Jun 3 23:04:01 2010 -0400
Re-enable "unsafe" buffering
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