Browse files

Add an 'escape valve' to safe buffer iteratee

  • Loading branch information...
1 parent 6dafc8f commit 987b888ffd74a79327080734e58171f3c0528f71 @gregorycollins gregorycollins committed May 30, 2010
Showing with 4 additions and 4 deletions.
  1. +1 −1 src/Snap/Internal/Http/Parser.hs
  2. +3 −3 src/Snap/Internal/Http/Server.hs
View
2 src/Snap/Internal/Http/Parser.hs
@@ -116,7 +116,7 @@ writeChunkedTransferEncoding :: ForeignPtr CChar
writeChunkedTransferEncoding _buf enum it = do
i' <- wrap it
--(i,_) <- unsafeBufferIterateeWithBuffer buf i'
- i <- bufferIteratee i'
+ (i,_) <- bufferIteratee i'
enum i
where
View
6 src/Snap/Internal/Http/Server.hs
@@ -306,10 +306,10 @@ httpSession writeEnd' ibuf onSendFile tickle handler = do
-- (writeEnd, cancelBuffering) <-
-- liftIO $ I.unsafeBufferIterateeWithBuffer ibuf writeEnd'
- -- let killBuffer = writeIORef cancelBuffering True
- writeEnd <- liftIO $ I.bufferIteratee writeEnd'
- let killBuffer = return ()
+ (writeEnd, cancelBuffering) <- liftIO $ I.bufferIteratee writeEnd'
+ let killBuffer = writeIORef cancelBuffering True
+
liftIO $ debug "Server.httpSession: entered"
mreq <- receiveRequest

0 comments on commit 987b888

Please sign in to comment.