summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaelSnoyman <>2012-04-12 03:59:05 (GMT)
committerhdiff <hdiff@luite.com>2012-04-12 03:59:05 (GMT)
commitd032924f02700587dacd7c0b76b4fb400c57a7ad (patch)
treea6da6775f3c194d2695bf7e1d53bd250e07b35c8
parent3e79d54f4948ea41dc83c8534f5985057f6a36f6 (diff)
version 1.4.11.4.1
-rw-r--r--Network/HTTP/Conduit.hs2
-rw-r--r--Network/HTTP/Conduit/Response.hs26
-rw-r--r--http-conduit.cabal4
3 files changed, 7 insertions, 25 deletions
diff --git a/Network/HTTP/Conduit.hs b/Network/HTTP/Conduit.hs
index 319f731..10cc742 100644
--- a/Network/HTTP/Conduit.hs
+++ b/Network/HTTP/Conduit.hs
@@ -173,7 +173,7 @@ http req0 manager = do
case checkStatus req0 status hs of
Nothing -> return res
Just exc -> do
- CI.pipeClose body
+ CI.runFinalize $ CI.pipeClose body
liftIO $ throwIO exc
where
go 0 _ _ = liftIO $ throwIO TooManyRedirects
diff --git a/Network/HTTP/Conduit/Response.hs b/Network/HTTP/Conduit/Response.hs
index d482381..13a15dd 100644
--- a/Network/HTTP/Conduit/Response.hs
+++ b/Network/HTTP/Conduit/Response.hs
@@ -23,10 +23,12 @@ import qualified Data.ByteString.Lazy as L
import qualified Data.CaseInsensitive as CI
import Control.Monad.Trans.Resource (MonadResource)
+import Control.Monad.Trans.Class (lift)
import qualified Data.Conduit as C
import qualified Data.Conduit.Zlib as CZ
import qualified Data.Conduit.Binary as CB
import qualified Data.Conduit.List as CL
+import qualified Data.Conduit.Internal
import qualified Network.HTTP.Types as W
@@ -118,7 +120,7 @@ checkHeaderLength :: MonadResource m
checkHeaderLength len C.NeedInput{}
| len <= 0 =
let x = liftIO $ throwIO OverlongHeaders
- in C.PipeM x x
+ in C.PipeM x (lift x)
checkHeaderLength len (C.NeedInput pushI closeI) = C.NeedInput
(\bs -> checkHeaderLength
(len - S8.length bs)
@@ -161,26 +163,6 @@ getResponse connRelease req@(Request {..}) src1 = do
if needsGunzip req hs'
then src3 C.$= CZ.ungzip
else src3
- return $ addCleanup cleanup src4
+ return $ Data.Conduit.Internal.addCleanup cleanup src4
return $ Response s version hs' body
-
--- | Add some cleanup code to the given 'C.Source'. General purpose
--- function, could be included in conduit itself.
-addCleanup :: Monad m
- => (Bool -> m ())
- -> C.Source m a
- -> C.Source m a
-addCleanup cleanup (C.Done leftover ()) = C.PipeM
- (cleanup True >> return (C.Done leftover ()))
- (cleanup True)
-addCleanup cleanup (C.HaveOutput src close x) = C.HaveOutput
- (addCleanup cleanup src)
- (cleanup False >> close)
- x
-addCleanup cleanup (C.PipeM msrc close) = C.PipeM
- (liftM (addCleanup cleanup) msrc)
- (cleanup False >> close)
-addCleanup cleanup (C.NeedInput p c) = C.NeedInput
- (addCleanup cleanup . p)
- (addCleanup cleanup c)
diff --git a/http-conduit.cabal b/http-conduit.cabal
index 5686048..19fa40b 100644
--- a/http-conduit.cabal
+++ b/http-conduit.cabal
@@ -1,5 +1,5 @@
name: http-conduit
-version: 1.4.0.2
+version: 1.4.1
license: BSD3
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
@@ -23,7 +23,7 @@ library
, transformers >= 0.2 && < 0.4
, failure >= 0.1
, resourcet >= 0.3 && < 0.4
- , conduit >= 0.4 && < 0.5
+ , conduit >= 0.4.1 && < 0.5
, zlib-conduit >= 0.4 && < 0.5
, blaze-builder-conduit >= 0.4 && < 0.5
, attoparsec-conduit >= 0.4 && < 0.5