Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-http-client for openSUSE:Factory
checked in at 2025-03-25 22:12:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-http-client (Old)
and /work/SRC/openSUSE:Factory/.ghc-http-client.new.2696 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-http-client"
Tue Mar 25 22:12:07 2025 rev:56 rq:1255893 version:0.7.19
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-http-client/ghc-http-client.changes
2024-12-29 11:56:34.444017525 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-http-client.new.2696/ghc-http-client.changes
2025-03-25 22:21:13.392520495 +0100
@@ -1,0 +2,8 @@
+Fri Mar 21 14:16:43 UTC 2025 - Peter Simons <[email protected]>
+
+- Update http-client to version 0.7.19.
+ ## 0.7.19
+
+ * Make mockable via `Network.HTTP.Client.Internal.requestAction`
[#554](https://github.com/snoyberg/http-client/pull/554)
+
+-------------------------------------------------------------------
Old:
----
http-client-0.7.18.tar.gz
New:
----
http-client-0.7.19.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-http-client.spec ++++++
--- /var/tmp/diff_new_pack.u13Lvj/_old 2025-03-25 22:21:13.816538094 +0100
+++ /var/tmp/diff_new_pack.u13Lvj/_new 2025-03-25 22:21:13.816538094 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-http-client
#
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -20,7 +20,7 @@
%global pkgver %{pkg_name}-%{version}
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.7.18
+Version: 0.7.19
Release: 0
Summary: An HTTP client engine
License: MIT
++++++ http-client-0.7.18.tar.gz -> http-client-0.7.19.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.18/ChangeLog.md
new/http-client-0.7.19/ChangeLog.md
--- old/http-client-0.7.18/ChangeLog.md 2024-12-19 08:02:17.000000000 +0100
+++ new/http-client-0.7.19/ChangeLog.md 2001-09-09 03:46:40.000000000 +0200
@@ -1,5 +1,9 @@
# Changelog for http-client
+## 0.7.19
+
+* Make mockable via `Network.HTTP.Client.Internal.requestAction`
[#554](https://github.com/snoyberg/http-client/pull/554)
+
## 0.7.18
* Add the `managerSetMaxNumberHeaders` function to the `Client` module to
configure `managerMaxNumberHeaders` in `ManagerSettings`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.18/Network/HTTP/Client/Core.hs
new/http-client-0.7.19/Network/HTTP/Client/Core.hs
--- old/http-client-0.7.18/Network/HTTP/Client/Core.hs 2024-12-19
08:02:17.000000000 +0100
+++ new/http-client-0.7.19/Network/HTTP/Client/Core.hs 2001-09-09
03:46:40.000000000 +0200
@@ -6,6 +6,7 @@
, httpNoBody
, httpRaw
, httpRaw'
+ , requestAction
, getModifiedRequestManager
, responseOpen
, responseClose
@@ -25,11 +26,13 @@
import Network.HTTP.Client.Cookies
import Data.Maybe (fromMaybe, isJust)
import Data.Time
+import Data.IORef
import Control.Exception
import qualified Data.ByteString.Lazy as L
import Data.Monoid
import Control.Monad (void)
import System.Timeout (timeout)
+import System.IO.Unsafe (unsafePerformIO)
import Data.KeyedPool
import GHC.IO.Exception (IOException(..), IOErrorType(..))
@@ -94,66 +97,86 @@
now <- getCurrentTime
return $ insertCookiesIntoRequest req' (evictExpiredCookies cj
now) now
Nothing -> return (req', Data.Monoid.mempty)
- (timeout', mconn) <- getConnectionWrapper
- (responseTimeout' req)
- (getConn req m)
-
- -- 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
- cont <- requestBuilder (dropProxyAuthSecure req) (managedResource
mconn)
-
- getResponse (mMaxHeaderLength m) (mMaxNumberHeaders m) timeout' req
mconn cont
-
- case ex of
- -- Connection was reused, and might have been closed. Try again
- Left e | managedReused mconn && mRetryableException m e -> do
- managedRelease mconn DontReuse
- httpRaw' req m
- -- Not reused, or a non-retry, so this is a real exception
- 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
- Just _ -> do
- now' <- getCurrentTime
- let (cookie_jar, _) = updateCookieJar res req now' cookie_jar'
- return (req, res {responseCookieJar = cookie_jar})
- Nothing -> return (req, res)
+ res <- makeRequest req m
+ case cookieJar req' of
+ Just _ -> do
+ now' <- getCurrentTime
+ let (cookie_jar, _) = updateCookieJar res req now' cookie_jar'
+ return (req, res {responseCookieJar = cookie_jar})
+ Nothing -> return (req, res)
+
+makeRequest
+ :: Request
+ -> Manager
+ -> IO (Response BodyReader)
+makeRequest req m = do
+ action <- readIORef requestAction
+ action req m
+
+requestAction :: IORef (Request -> Manager -> IO (Response BodyReader))
+{-# NOINLINE requestAction #-}
+requestAction = unsafePerformIO (newIORef action)
where
- getConnectionWrapper mtimeout f =
- case mtimeout of
- Nothing -> fmap ((,) Nothing) f
- Just timeout' -> do
- before <- getCurrentTime
- mres <- timeout timeout' f
- case mres of
- 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
- ResponseTimeoutDefault ->
- case mResponseTimeout m of
- ResponseTimeoutDefault -> Just 30000000
- ResponseTimeoutNone -> Nothing
- ResponseTimeoutMicro u -> Just u
- ResponseTimeoutNone -> Nothing
- ResponseTimeoutMicro u -> Just u
+ action
+ :: Request
+ -> Manager
+ -> IO (Response BodyReader)
+ action req m = do
+ (timeout', mconn) <- getConnectionWrapper
+ (responseTimeout' req)
+ (getConn req m)
+
+ -- 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
+ cont <- requestBuilder (dropProxyAuthSecure req) (managedResource
mconn)
+
+ getResponse (mMaxHeaderLength m) (mMaxNumberHeaders m) timeout'
req mconn cont
+
+ case ex of
+ -- Connection was reused, and might have been closed. Try again
+ Left e | managedReused mconn && mRetryableException m e -> do
+ managedRelease mconn DontReuse
+ action req m
+ -- Not reused, or a non-retry, so this is a real exception
+ 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 -> return res
+ where
+ getConnectionWrapper mtimeout f =
+ case mtimeout of
+ Nothing -> fmap ((,) Nothing) f
+ Just timeout' -> do
+ before <- getCurrentTime
+ mres <- timeout timeout' f
+ case mres of
+ 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
+ ResponseTimeoutDefault ->
+ case mResponseTimeout m of
+ ResponseTimeoutDefault -> Just 30000000
+ ResponseTimeoutNone -> Nothing
+ ResponseTimeoutMicro u -> Just u
+ ResponseTimeoutNone -> Nothing
+ ResponseTimeoutMicro u -> Just u
-- | The used Manager can be overridden (by requestManagerOverride) and the
used
-- Request can be modified (through managerModifyRequest). This function allows
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-0.7.18/http-client.cabal
new/http-client-0.7.19/http-client.cabal
--- old/http-client-0.7.18/http-client.cabal 2024-12-19 08:02:17.000000000
+0100
+++ new/http-client-0.7.19/http-client.cabal 2001-09-09 03:46:40.000000000
+0200
@@ -1,5 +1,5 @@
name: http-client
-version: 0.7.18
+version: 0.7.19
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