http-conduit 2.3.8 → 2.3.9.1
raw patch · 4 files changed
Files
- ChangeLog.md +20/−0
- Network/HTTP/Conduit.hs +16/−10
- http-conduit.cabal +6/−4
- test/main.hs +1/−1
ChangeLog.md view
@@ -1,5 +1,25 @@ # ChangeLog for http-conduit +## 2.3.9.1++* data-default-class -> data-default [#546](https://github.com/snoyberg/http-client/pull/546/files)++## 2.3.9++* Fix space leaks when closing responses [#539](https://github.com/snoyberg/http-client/pull/539)++## 2.3.8.3++* aeson 2.2 support [#512](https://github.com/snoyberg/http-client/pull/512)++## 2.3.8.2++* Add missing `crypton-connection` dependency++## 2.3.8.1++* Drop `connection` dependency+ ## 2.3.8 * Adds `setRequestBearerAuth` convenience function. Note that this is only available for `http-client` versions 0.7.6 or greater. [#457](https://github.com/snoyberg/http-client/pull/457/files)
Network/HTTP/Conduit.hs view
@@ -179,6 +179,7 @@ , responseHeaders , responseBody , responseCookieJar+ , responseEarlyHints -- * Manager , Manager , newManager@@ -232,7 +233,7 @@ import Control.Monad.IO.Unlift (MonadIO (liftIO)) import Control.Monad.Trans.Resource -import qualified Network.HTTP.Client as Client (httpLbs, responseOpen, responseClose)+import qualified Network.HTTP.Client as Client (httpLbs, responseOpen) import qualified Network.HTTP.Client as HC import qualified Network.HTTP.Client.Conduit as HCC import Network.HTTP.Client.Internal (createCookieJar,@@ -243,9 +244,8 @@ managerTlsConnection, newManager) import Network.HTTP.Client (parseUrl, parseUrlThrow, urlEncodedBody, applyBasicAuth, defaultRequest, parseRequest, parseRequest_)-import Network.HTTP.Client.Internal (addProxy, alwaysDecompress,- browserDecompress)-import Network.HTTP.Client.Internal (getRedirectedRequest)+import Network.HTTP.Client.Internal (ResponseClose (..), addProxy, alwaysDecompress,+ browserDecompress, getRedirectedRequest) import Network.HTTP.Client.TLS (mkManagerSettings, tlsManagerSettings) import Network.HTTP.Client.Internal (Cookie (..), CookieJar (..),@@ -315,12 +315,18 @@ => Request -> Manager -> m (Response (ConduitM i S.ByteString m ()))-http req man = do- (key, res) <- allocate (Client.responseOpen req man) Client.responseClose- return res { responseBody = do- HCC.bodyReaderSource $ responseBody res- release key- }+http req man = resourceMask $ \_ -> do+ res <- liftIO $ Client.responseOpen req man+ -- Move the cleanup action for the response into `ResourceT` so+ -- that we can release it from the `ReleaseMap` as soon as the+ -- response is closed or the body is consumed.+ let ResponseClose cleanup = responseClose' res+ key <- register cleanup+ pure res { responseClose' = ResponseClose $ release key+ , responseBody = do+ HCC.bodyReaderSource $ responseBody res+ release key+ } requestBodySource :: Int64 -> ConduitM () S.ByteString (ResourceT IO) () -> RequestBody requestBodySource size = RequestBodyStream size . srcToPopper
http-conduit.cabal view
@@ -1,6 +1,6 @@ cabal-version: >= 1.10 name: http-conduit-version: 2.3.8+version: 2.3.9.1 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -10,7 +10,7 @@ category: Web, Conduit stability: Stable build-type: Simple-homepage: http://www.yesodweb.com/book/http-conduit+homepage: https://github.com/snoyberg/http-client extra-source-files: test/main.hs , test/CookieTest.hs , multipart-example.bin@@ -42,6 +42,7 @@ if flag(aeson) build-depends: aeson >= 0.8+ , attoparsec-aeson >= 2.1 if !impl(ghc>=7.9) build-depends: void >= 0.5.5@@ -62,8 +63,8 @@ build-depends: base >= 4 && < 5 , HUnit , hspec >= 1.3- , data-default-class- , connection >= 0.2+ , data-default+ , crypton-connection , warp-tls , tls < 1.5 || >= 1.5.2 , time@@ -90,6 +91,7 @@ if flag(aeson) build-depends: aeson+ , attoparsec-aeson >= 2.1 source-repository head type: git
test/main.hs view
@@ -48,7 +48,7 @@ import Data.Time.Calendar import qualified Network.Wai.Handler.WarpTLS as WT import Network.Connection (settingDisableCertificateValidation)-import Data.Default.Class (def)+import Data.Default (def) #ifdef VERSION_aeson import qualified Data.Aeson as A #endif