Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

finishDeflate

  • Loading branch information...
commit 453ed43fb0ab2d04061f31b9a7bb100b4084f47e 1 parent 5b36494
@snoyberg authored
Showing with 5 additions and 2 deletions.
  1. +1 −0  Network/HTTP/Enumerator.hs
  2. +4 −2 Network/HTTP/Enumerator/Zlib.hs
View
1  Network/HTTP/Enumerator.hs
@@ -582,4 +582,5 @@ urlEncodedBody headers req = req
| c < 16 = Blaze.writeByte $ c + 55
| otherwise = error $ "hexChar: " ++ show c
+catchParser :: Monad m => String -> Iteratee a m b -> Iteratee a m b
catchParser s i = catchError i (const $ throwError $ HttpParserException s)
View
6 Network/HTTP/Enumerator/Zlib.hs
@@ -14,11 +14,13 @@ ungzip inner = do
fzstr <- liftIO $ initInflate $ WindowBits 31
ungzip' fzstr inner
-ungzip' :: MonadIO m => ZStream -> Enumeratee S.ByteString S.ByteString m b
+ungzip' :: MonadIO m => Inflate -> Enumeratee S.ByteString S.ByteString m b
ungzip' fzstr (Continue k) = do
x <- head
case x of
- Nothing -> return $ Continue k
+ Nothing -> do
+ chunk <- liftIO $ finishInflate fzstr
+ lift $ runIteratee $ k $ Chunks [chunk]
Just bs -> do
chunks <- liftIO $ withInflateInput fzstr bs $ go id
step <- lift $ runIteratee $ k $ Chunks chunks
Please sign in to comment.
Something went wrong with that request. Please try again.