Permalink
Browse files

Fix MonadCatchIO instance for Iteratee (again) -- was gobbling uncons…

…umed input when it didn't have to.
  • Loading branch information...
1 parent 842b09d commit 3237c81677e03284a2bebb6aa90b0c92f704568f @gregorycollins gregorycollins committed Apr 4, 2011
Showing with 1 addition and 6 deletions.
  1. +1 −6 src/Snap/Iteratee.hs
View
@@ -129,7 +129,6 @@ import System.PosixCompat.Files
import System.PosixCompat.Types
#endif
-
------------------------------------------------------------------------------
instance (Functor m, MonadCatchIO m) =>
MonadCatchIO (Iteratee s m) where
@@ -139,11 +138,7 @@ instance (Functor m, MonadCatchIO m) =>
insideCatch !mm = Iteratee $ do
ee <- try $ runIteratee mm
case ee of
- -- if we got an async exception here then the iteratee workflow is
- -- all messed up, we have no reasonable choice but to send EOF to the
- -- handler, because the unparsed input got lost. If the enumerator
- -- sends more chunks we can possibly recover later.
- (Left e) -> runIteratee (enumEOF $$ handler e)
+ (Left e) -> runIteratee $ handler e
(Right v) -> step v
step (Continue !k) = do

0 comments on commit 3237c81

Please sign in to comment.