commit ghc-connection for openSUSE:Factory
Hello community, here is the log from the commit of package ghc-connection for openSUSE:Factory checked in at 2017-02-22 13:53:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-connection (Old) and /work/SRC/openSUSE:Factory/.ghc-connection.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-connection" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-connection/ghc-connection.changes 2016-08-25 09:57:58.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-connection.new/ghc-connection.changes 2017-02-22 13:53:20.593950111 +0100 @@ -1,0 +2,5 @@ +Mon Jan 30 09:26:45 UTC 2017 - psimons@suse.com + +- Update to version 0.2.7 with cabal2obs. + +------------------------------------------------------------------- Old: ---- connection-0.2.6.tar.gz New: ---- connection-0.2.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-connection.spec ++++++ --- /var/tmp/diff_new_pack.aoHTZc/_old 2017-02-22 13:53:21.001892060 +0100 +++ /var/tmp/diff_new_pack.aoHTZc/_new 2017-02-22 13:53:21.005891491 +0100 @@ -1,7 +1,7 @@ # # spec file for package ghc-connection # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 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 @@ -18,7 +18,7 @@ %global pkg_name connection Name: ghc-%{pkg_name} -Version: 0.2.6 +Version: 0.2.7 Release: 0 Summary: Simple and easy network connections API License: BSD-3-Clause ++++++ connection-0.2.6.tar.gz -> connection-0.2.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/connection-0.2.6/Network/Connection.hs new/connection-0.2.7/Network/Connection.hs --- old/connection-0.2.6/Network/Connection.hs 2016-08-12 08:23:14.000000000 +0200 +++ new/connection-0.2.7/Network/Connection.hs 2017-01-26 17:00:15.000000000 +0100 @@ -41,6 +41,7 @@ , connectionGetChunk , connectionGetChunk' , connectionGetLine + , connectionWaitForInput , connectionPut -- * TLS related operation @@ -74,6 +75,7 @@ import qualified Data.ByteString.Lazy as L import System.Environment +import System.Timeout import System.IO import qualified Data.Map as M @@ -170,8 +172,9 @@ -> IO Connection -- ^ The new established connection on success. connectTo cg cParams = do conFct <- getConFct (connectionUseSocks cParams) - h <- conFct (connectionHostname cParams) (N.PortNumber $ connectionPort cParams) - connectFromSocket cg h cParams + let doConnect = conFct (connectionHostname cParams) (N.PortNumber $ connectionPort cParams) + E.bracketOnError doConnect N.close $ \h-> + connectFromSocket cg h cParams where getConFct Nothing = return resolve' getConFct (Just (OtherProxy h p)) = return $ \_ _ -> resolve' h (N.PortNumber p) @@ -273,6 +276,19 @@ connectionGetChunk' :: Connection -> (ByteString -> (a, ByteString)) -> IO a connectionGetChunk' = connectionGetChunkBase "connectionGetChunk'" +-- | Wait for input to become available on a connection. +-- +-- As with 'hWaitForInput', the timeout value is given in milliseconds. If the +-- timeout value is less than zero, then 'connectionWaitForInput' waits +-- indefinitely. +-- +-- Unlike 'hWaitForInput', this function does not do any decoding, so it +-- returns true when there is /any/ available input, not just full characters. +connectionWaitForInput :: Connection -> Int -> IO Bool +connectionWaitForInput conn timeout_ms = maybe False (const True) <$> timeout timeout_ns tryGetChunk + where tryGetChunk = connectionGetChunkBase "connectionWaitForInput" conn $ \buf -> ((), buf) + timeout_ns = timeout_ms * 1000 + connectionGetChunkBase :: String -> Connection -> (ByteString -> (a, ByteString)) -> IO a connectionGetChunkBase loc conn f = modifyMVar (connectionBuffer conn) $ \m -> @@ -336,7 +352,7 @@ join $ connectionGetChunkBase loc conn $ \s -> if B.null s then (eofK, B.empty) - else case B.breakByte 10 s of + else case B.break (== 10) s of (a, b) | B.null b -> (moreK a, B.empty) | otherwise -> (doneK a, B.tail b) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/connection-0.2.6/connection.cabal new/connection-0.2.7/connection.cabal --- old/connection-0.2.6/connection.cabal 2016-08-12 08:23:14.000000000 +0200 +++ new/connection-0.2.7/connection.cabal 2017-01-26 17:00:39.000000000 +0100 @@ -1,5 +1,5 @@ Name: connection -Version: 0.2.6 +Version: 0.2.7 Description: Simple network library for all your connection need. .
participants (1)
-
root@hilbertn.suse.de