http-client 0.7.4 → 0.7.5
raw patch · 3 files changed
+20/−10 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- Network/HTTP/Client/Core.hs +15/−9
- http-client.cabal +1/−1
ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for http-client +## 0.7.5++* Force closing connections in case of exceptions throwing [#454](https://github.com/snoyberg/http-client/pull/454).+ ## 0.7.4 * Depend on base64-bytestring instead of memory [#453](https://github.com/snoyberg/http-client/pull/453)
Network/HTTP/Client/Core.hs view
@@ -111,7 +111,11 @@ managedRelease mconn DontReuse httpRaw' req m -- Not reused, or a non-retry, so this is a real exception- Left e -> throwIO e+ Left e -> do+ -- Explicitly release connection for all real exceptions:+ -- https://github.com/snoyberg/http-client/pull/454+ managedRelease mconn DontReuse+ throwIO e -- Everything went ok, so the connection is good. If any exceptions get -- thrown in the response body, just throw them as normal. Right res -> case cookieJar req' of@@ -128,14 +132,16 @@ before <- getCurrentTime mres <- timeout timeout' f case mres of- Nothing -> throwHttp ConnectionTimeout- Just res -> do- now <- getCurrentTime- let timeSpentMicro = diffUTCTime now before * 1000000- remainingTime = round $ fromIntegral timeout' - timeSpentMicro- if remainingTime <= 0- then throwHttp ConnectionTimeout- else return (Just remainingTime, res)+ Nothing -> throwHttp ConnectionTimeout+ Just mConn -> do+ now <- getCurrentTime+ let timeSpentMicro = diffUTCTime now before * 1000000+ remainingTime = round $ fromIntegral timeout' - timeSpentMicro+ if remainingTime <= 0+ then do+ managedRelease mConn DontReuse+ throwHttp ConnectionTimeout+ else return (Just remainingTime, mConn) responseTimeout' req = case responseTimeout req of
http-client.cabal view
@@ -1,5 +1,5 @@ name: http-client-version: 0.7.4+version: 0.7.5 synopsis: An HTTP client engine description: Hackage documentation generation is not reliable. For up to date documentation, please see: <http://www.stackage.org/package/http-client>. homepage: https://github.com/snoyberg/http-client