packages feed

http-conduit 1.4.1.1 → 1.4.1.2

raw patch · 2 files changed

+16/−5 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Network/HTTP/Conduit.hs view
@@ -195,8 +195,16 @@ httpRaw req m = do     (connRelease, ci, isManaged) <- getConn req m     let src = connSource ci-    ex <- try $ requestBuilder req C.$$ builderToByteString C.=$ connSink ci-    case (ex :: Either SomeException (), isManaged) of++    -- Originally, we would only test for exceptions when sending the request,+    -- not on calling @getResponse@. However, some servers seem to close+    -- connections after accepting the request headers, so we need to check for+    -- exceptions in both.+    ex <- try' $ do+        requestBuilder req C.$$ builderToByteString C.=$ connSink ci+        getResponse connRelease req src++    case (ex, isManaged) of         -- Connection was reused, and might be been closed. Try again         (Left _, Reused) -> do             connRelease DontReuse@@ -204,8 +212,11 @@         -- Not reused, so this is a real exception         (Left e, Fresh) -> liftIO $ throwIO e         -- Everything went ok, so the connection is good. If any exceptions get-        -- thrown in the rest of the code, just throw them as normal.-        (Right (), _) -> getResponse connRelease req src+        -- thrown in the response body, just throw them as normal.+        (Right x, _) -> return x+  where+    try' :: MonadBaseControl IO m => m a -> m (Either SomeException a)+    try' = try  -- | Download the specified 'Request', returning the results as a 'Response'. --
http-conduit.cabal view
@@ -1,5 +1,5 @@ name:            http-conduit-version:         1.4.1.1+version:         1.4.1.2 license:         BSD3 license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>