Hello community,
here is the log from the commit of package ghc-http-client-tls for
openSUSE:Factory checked in at 2016-04-22 16:25:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-http-client-tls (Old)
and /work/SRC/openSUSE:Factory/.ghc-http-client-tls.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-http-client-tls"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-http-client-tls/ghc-http-client-tls.changes
2015-05-21 08:37:06.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.ghc-http-client-tls.new/ghc-http-client-tls.changes
2016-04-22 16:25:23.000000000 +0200
@@ -1,0 +2,12 @@
+Sat Apr 16 07:13:00 UTC 2016 - [email protected]
+
+- update to 0.2.4
+* Global manager
+
+-------------------------------------------------------------------
+Tue Apr 12 10:02:46 UTC 2016 - [email protected]
+
+- update to 0.2.3
+* Exception catching cleanup
+
+-------------------------------------------------------------------
Old:
----
http-client-tls-0.2.2.tar.gz
New:
----
http-client-tls-0.2.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-http-client-tls.spec ++++++
--- /var/tmp/diff_new_pack.jKMSiy/_old 2016-04-22 16:25:23.000000000 +0200
+++ /var/tmp/diff_new_pack.jKMSiy/_new 2016-04-22 16:25:23.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-http-client-tls
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,9 +19,9 @@
%bcond_with tests
-Name: ghc-%{pkg_name}
-Version: 0.2.2
-Release: 1
+Name: ghc-http-client-tls
+Version: 0.2.4
+Release: 0
Summary: Http-client backend using the connection package and tls
library
Group: System/Libraries
++++++ http-client-tls-0.2.2.tar.gz -> http-client-tls-0.2.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-tls-0.2.2/ChangeLog.md
new/http-client-tls-0.2.4/ChangeLog.md
--- old/http-client-tls-0.2.2/ChangeLog.md 1970-01-01 01:00:00.000000000
+0100
+++ new/http-client-tls-0.2.4/ChangeLog.md 2016-04-15 10:51:33.000000000
+0200
@@ -0,0 +1,7 @@
+## 0.2.4
+
+* Global manager
+
+## 0.2.3
+
+* Exception catching cleanup
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-tls-0.2.2/Network/HTTP/Client/TLS.hs
new/http-client-tls-0.2.4/Network/HTTP/Client/TLS.hs
--- old/http-client-tls-0.2.2/Network/HTTP/Client/TLS.hs 2014-07-15
07:01:15.000000000 +0200
+++ new/http-client-tls-0.2.4/Network/HTTP/Client/TLS.hs 2016-04-15
10:51:33.000000000 +0200
@@ -1,9 +1,16 @@
{-# LANGUAGE ScopedTypeVariables #-}
-- | Support for making connections via the connection package and, in turn,
-- the tls package suite.
+--
+-- Recommended reading:
<https://github.com/commercialhaskell/jump/blob/master/doc/http-client.md>
module Network.HTTP.Client.TLS
- ( tlsManagerSettings
+ ( -- * Settings
+ tlsManagerSettings
, mkManagerSettings
+ -- * Global manager
+ , getGlobalManager
+ , setGlobalManager
+ -- * Internal
, getTlsConnection
) where
@@ -15,7 +22,11 @@
import Network.Socket (HostAddress)
import qualified Network.TLS as TLS
import qualified Data.ByteString as S
+import Data.IORef (IORef, newIORef, readIORef, writeIORef)
+import System.IO.Unsafe (unsafePerformIO)
+-- | Create a TLS-enabled 'ManagerSettings' with the given 'NC.TLSSettings' and
+-- 'NC.SockSettings'
mkManagerSettings :: NC.TLSSettings
-> Maybe NC.SockSettings
-> ManagerSettings
@@ -42,23 +53,19 @@
Just NoResponseDataReceived -> True
Just IncompleteHeaders -> True
_ -> False
- , managerWrapIOException =
+ , managerWrapIOException =
let wrapper se =
case fromException se of
Just e -> toException $ InternalIOException e
- Nothing ->
- case fromException se of
- Just TLS.Terminated{} -> toException $
TlsException se
- _ ->
- case fromException se of
- Just TLS.HandshakeFailed{} -> toException
$ TlsException se
- _ ->
- case fromException se of
- Just TLS.ConnectionNotEstablished
-> toException $ TlsException se
- _ -> se
+ Nothing -> case fromException se of
+ Just TLS.Terminated{} -> toException $ TlsException se
+ Just TLS.HandshakeFailed{} -> toException $ TlsException
se
+ Just TLS.ConnectionNotEstablished -> toException $
TlsException se
+ _ -> se
in handle $ throwIO . wrapper
}
+-- | Default TLS-enabled manager settings
tlsManagerSettings :: ManagerSettings
tlsManagerSettings = mkManagerSettings def Nothing
@@ -111,3 +118,21 @@
-- on the socket. But when this is called the socket might be
-- already closed, and we get a @ResourceVanished@.
(NC.connectionClose conn `Control.Exception.catch` \(_ :: IOException) ->
return ())
+
+-- | Evil global manager, to make life easier for the common use case
+globalManager :: IORef Manager
+globalManager = unsafePerformIO (newManager tlsManagerSettings >>= newIORef)
+{-# NOINLINE globalManager #-}
+
+-- | Get the current global 'Manager'
+--
+-- @since 0.2.4
+getGlobalManager :: IO Manager
+getGlobalManager = readIORef globalManager
+{-# INLINE getGlobalManager #-}
+
+-- | Set the current global 'Manager'
+--
+-- @since 0.2.4
+setGlobalManager :: Manager -> IO ()
+setGlobalManager = writeIORef globalManager
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-tls-0.2.2/README.md
new/http-client-tls-0.2.4/README.md
--- old/http-client-tls-0.2.2/README.md 1970-01-01 01:00:00.000000000 +0100
+++ new/http-client-tls-0.2.4/README.md 2016-04-15 10:51:33.000000000 +0200
@@ -0,0 +1,18 @@
+## http-client-tls
+
+Full tutorial docs are available at:
+https://github.com/commercialhaskell/jump/blob/master/doc/http-client.md
+
+Use the http-client package with the pure-Haskell tls package for secure
+connections. For the most part, you'll just want to replace
+`defaultManagerSettings` with `tlsManagerSettings`, e.g.:
+
+```haskell
+import Network.HTTP.Client
+import Network.HTTP.Client.TLS
+
+main :: IO ()
+main = do
+ manager <- newManager tlsManagerSettings
+ ...
+```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/http-client-tls-0.2.2/http-client-tls.cabal
new/http-client-tls-0.2.4/http-client-tls.cabal
--- old/http-client-tls-0.2.2/http-client-tls.cabal 2014-07-15
07:01:15.000000000 +0200
+++ new/http-client-tls-0.2.4/http-client-tls.cabal 2016-04-15
10:51:33.000000000 +0200
@@ -1,7 +1,7 @@
name: http-client-tls
-version: 0.2.2
+version: 0.2.4
synopsis: http-client backend using the connection package and tls
library
-description: Intended for use by higher-level libraries, such as
http-conduit.
+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
license: MIT
license-file: LICENSE
@@ -10,6 +10,8 @@
category: Network
build-type: Simple
cabal-version: >=1.10
+extra-source-files: README.md
+ ChangeLog.md
library
exposed-modules: Network.HTTP.Client.TLS
@@ -19,7 +21,7 @@
, http-client >= 0.3.5
, connection >= 0.2.2
, network
- , tls >=1.1
+ , tls >= 1.2
, bytestring
default-language: Haskell2010