Skip to content

Commit

Permalink
Fix MonadCatchIO instance for Iteratee (again) -- was gobbling uncons…
Browse files Browse the repository at this point in the history
…umed input when it didn't have to.
  • Loading branch information
gregorycollins committed Apr 4, 2011
1 parent 842b09d commit 3237c81
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Snap/Iteratee.hs
Expand Up @@ -129,7 +129,6 @@ import System.PosixCompat.Files
import System.PosixCompat.Types
#endif


------------------------------------------------------------------------------
instance (Functor m, MonadCatchIO m) =>
MonadCatchIO (Iteratee s m) where
Expand All @@ -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
Expand Down

0 comments on commit 3237c81

Please sign in to comment.