Hello community, here is the log from the commit of package ghc-connection for openSUSE:Factory checked in at 2019-10-18 14:33:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-connection (Old) and /work/SRC/openSUSE:Factory/.ghc-connection.new.2352 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-connection" Fri Oct 18 14:33:54 2019 rev:12 rq:737196 version:0.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-connection/ghc-connection.changes 2019-04-28 20:12:35.434450652 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-connection.new.2352/ghc-connection.changes 2019-10-18 14:33:57.396157645 +0200 @@ -1,0 +2,7 @@ +Tue Sep 3 02:02:41 UTC 2019 - [email protected] + +- Update connection to version 0.3.1. + Upstream has not updated the file "CHANGELOG.md" since the last + release. + +------------------------------------------------------------------- Old: ---- connection-0.3.0.tar.gz New: ---- connection-0.3.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-connection.spec ++++++ --- /var/tmp/diff_new_pack.B6Sujr/_old 2019-10-18 14:33:58.320155238 +0200 +++ /var/tmp/diff_new_pack.B6Sujr/_new 2019-10-18 14:33:58.324155227 +0200 @@ -18,7 +18,7 @@ %global pkg_name connection Name: ghc-%{pkg_name} -Version: 0.3.0 +Version: 0.3.1 Release: 0 Summary: Simple and easy network connections API License: BSD-3-Clause ++++++ connection-0.3.0.tar.gz -> connection-0.3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/connection-0.3.0/Network/Connection.hs new/connection-0.3.1/Network/Connection.hs --- old/connection-0.3.0/Network/Connection.hs 2019-04-22 12:26:35.000000000 +0200 +++ new/connection-0.3.1/Network/Connection.hs 2019-09-02 06:23:33.000000000 +0200 @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -64,6 +65,7 @@ import Network.Socket import qualified Network.Socket.ByteString as N +import Data.Tuple (swap) import Data.Default.Class import Data.Data import Data.ByteString (ByteString) @@ -100,6 +102,10 @@ , TLS.sessionEstablish = \sessionID sessionData -> modifyMVar_ mvar (return . M.insert sessionID sessionData) , TLS.sessionInvalidate = \sessionID -> modifyMVar_ mvar (return . M.delete sessionID) +#if MIN_VERSION_tls(1,5,0) + , TLS.sessionResumeOnlyOnce = \sessionID -> + modifyMVar mvar (pure . swap . M.updateLookupWithKey (\_ _ -> Nothing) sessionID) +#endif } -- | Initialize the library with shared parameters between connection. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/connection-0.3.0/README.md new/connection-0.3.1/README.md --- old/connection-0.3.0/README.md 2019-01-27 08:49:08.000000000 +0100 +++ new/connection-0.3.1/README.md 2019-09-02 06:29:41.000000000 +0200 @@ -14,68 +14,70 @@ Connect to www.example.com on port 4567 (without socks or tls), then send a byte, receive a single byte, print it, and close the connection: +```haskell +import qualified Data.ByteString as B +import Network.Connection +import Data.Default - import qualified Data.ByteString as B - import Network.Connection - import Data.Default - - main = do - ctx <- initConnectionContext - con <- connectTo ctx $ ConnectionParams - { connectionHostname = "www.example.com" - , connectionPort = 4567 - , connectionUseSecure = Nothing - , connectionUseSocks = Nothing - } - connectionPut con (B.singleton 0xa) - r <- connectionGet con 1 - putStrLn $ show r - connectionClose con - +main = do + ctx <- initConnectionContext + con <- connectTo ctx $ ConnectionParams + { connectionHostname = "www.example.com" + , connectionPort = 4567 + , connectionUseSecure = Nothing + , connectionUseSocks = Nothing + } + connectionPut con (B.singleton 0xa) + r <- connectionGet con 1 + putStrLn $ show r + connectionClose con +``` Using a socks proxy is easy, we just need replacing the connectionSocks parameter, for example connecting to the same host, but using a socks proxy at localhost:1080: - - con <- connectTo ctx $ ConnectionParams - { connectionHostname = "www.example.com" - , connectionPort = 4567 - , connectionUseSecure = Nothing - , connectionUseSocks = Just $ SockSettingsSimple "localhost" 1080 - } - +```haskell +con <- connectTo ctx $ ConnectionParams + { connectionHostname = "www.example.com" + , connectionPort = 4567 + , connectionUseSecure = Nothing + , connectionUseSocks = Just $ SockSettingsSimple "localhost" 1080 + } +``` Connecting to a SSL style socket is equally easy, and need to set the UseSecure fields in ConnectionParams: - - con <- connectTo ctx $ ConnectionParams - { connectionHostname = "www.example.com" - , connectionPort = 4567 - , connectionUseSecure = Just def - , connectionUseSocks = Nothing - } - +```haskell +con <- connectTo ctx $ ConnectionParams + { connectionHostname = "www.example.com" + , connectionPort = 4567 + , connectionUseSecure = Just def + , connectionUseSocks = Nothing + } +``` And finally, you can start TLS in the middle of an insecure connection. This is great for protocol using STARTTLS (e.g. IMAP, SMTP): - {-# LANGUAGE OverloadedStrings #-} - import qualified Data.ByteString as B - import Data.ByteString.Char8 () - import Network.Connection - import Data.Default - - main = do - ctx <- initConnectionContext - con <- connectTo ctx $ ConnectionParams - { connectionHostname = "www.example.com" - , connectionPort = 4567 - , connectionUseSecure = Nothing - , connectionUseSocks = Nothing - } - -- talk to the other side with no TLS: says hello and starttls - connectionPut con "HELLO\n" - connectionPut con "STARTTLS\n" - - -- switch to TLS - connectionSetSecure ctx con def - - -- the connection is from now on using TLS, we can send secret for example - connectionPut con "PASSWORD 123\n" - connectionClose con +```haskell +{-# LANGUAGE OverloadedStrings #-} +import qualified Data.ByteString as B +import Data.ByteString.Char8 () +import Network.Connection +import Data.Default + +main = do + ctx <- initConnectionContext + con <- connectTo ctx $ ConnectionParams + { connectionHostname = "www.example.com" + , connectionPort = 4567 + , connectionUseSecure = Nothing + , connectionUseSocks = Nothing + } + -- talk to the other side with no TLS: says hello and starttls + connectionPut con "HELLO\n" + connectionPut con "STARTTLS\n" + + -- switch to TLS + connectionSetSecure ctx con def + + -- the connection is from now on using TLS, we can send secret for example + connectionPut con "PASSWORD 123\n" + connectionClose con +``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/connection-0.3.0/connection.cabal new/connection-0.3.1/connection.cabal --- old/connection-0.3.0/connection.cabal 2019-04-22 12:11:03.000000000 +0200 +++ new/connection-0.3.1/connection.cabal 2019-09-02 06:33:24.000000000 +0200 @@ -1,5 +1,5 @@ Name: connection -Version: 0.3.0 +Version: 0.3.1 Description: Simple network library for all your connection need. . @@ -27,7 +27,7 @@ , bytestring , containers , data-default-class - , network >= 2.6 + , network >= 2.6.3 , tls >= 1.4 , socks >= 0.6 , x509 >= 1.5 ++++++ connection.cabal ++++++ --- /var/tmp/diff_new_pack.B6Sujr/_old 2019-10-18 14:33:58.408155009 +0200 +++ /var/tmp/diff_new_pack.B6Sujr/_new 2019-10-18 14:33:58.408155009 +0200 @@ -1,44 +1,44 @@ -Name: connection -Version: 0.3.0 -x-revision: 1 -Description: - Simple network library for all your connection need. - . - Features: Really simple to use, SSL/TLS, SOCKS. - . - This library provides a very simple api to create sockets - to a destination with the choice of SSL/TLS, and SOCKS. -License: BSD3 -License-file: LICENSE -Copyright: Vincent Hanquez <[email protected]> -Author: Vincent Hanquez <[email protected]> -Maintainer: Vincent Hanquez <[email protected]> -Synopsis: Simple and easy network connections API -Build-Type: Simple -Category: Network -stability: experimental -Cabal-Version: >=1.6 -Homepage: https://github.com/vincenthz/hs-connection -extra-source-files: README.md - CHANGELOG.md - -Library - Build-Depends: base >= 4.8 && < 5 - , basement - , bytestring - , containers - , data-default-class - , network >= 2.6 - , tls >= 1.4 - , socks >= 0.6 - , x509 >= 1.5 - , x509-store >= 1.5 - , x509-system >= 1.5 - , x509-validation >= 1.5 - Exposed-modules: Network.Connection - Other-modules: Network.Connection.Types - ghc-options: -Wall - -source-repository head - type: git - location: https://github.com/vincenthz/hs-connection +Name: connection +Version: 0.3.1 +x-revision: 1 +Description: + Simple network library for all your connection need. + . + Features: Really simple to use, SSL/TLS, SOCKS. + . + This library provides a very simple api to create sockets + to a destination with the choice of SSL/TLS, and SOCKS. +License: BSD3 +License-file: LICENSE +Copyright: Vincent Hanquez <[email protected]> +Author: Vincent Hanquez <[email protected]> +Maintainer: Vincent Hanquez <[email protected]> +Synopsis: Simple and easy network connections API +Build-Type: Simple +Category: Network +stability: experimental +Cabal-Version: >=1.6 +Homepage: https://github.com/vincenthz/hs-connection +extra-source-files: README.md + CHANGELOG.md + +Library + Build-Depends: base >= 4.8 && < 5 + , basement + , bytestring + , containers + , data-default-class + , network >= 2.6.3 + , tls >= 1.4 + , socks >= 0.6 + , x509 >= 1.5 + , x509-store >= 1.5 + , x509-system >= 1.5 + , x509-validation >= 1.5 + Exposed-modules: Network.Connection + Other-modules: Network.Connection.Types + ghc-options: -Wall + +source-repository head + type: git + location: https://github.com/vincenthz/hs-connection
