Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-network for openSUSE:Factory checked in at 2026-11-27 19:45:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-network (Old) and /work/SRC/openSUSE:Factory/.ghc-network.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-network" Fri Nov 27 19:45:06 2026 rev:39 rq:1401153 version:3.2.16.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-network/ghc-network.changes 2026-11-24 12:38:33.529278344 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-network.new.1340718/ghc-network.changes 2026-11-27 19:49:21.120860323 +0100 @@ -1,0 +2,18 @@ +Mon Nov 23 03:48:59 UTC 2026 - Peter Simons <[email protected]> + +- Update network to version 3.2.16.0. + ## Version 3.2.16.0 + + * Export AcceptConn + [#665](https://github.com/haskell/network/pull/665) + +------------------------------------------------------------------- +Sun Nov 22 04:23:28 UTC 2026 - Peter Simons <[email protected]> + +- Update network to version 3.2.15.0. + ## Version 3.2.15.0 + + * acceptWith: keep to the give-up when another waiter takes the connection + [#663](https://github.com/haskell/network/pull/663) + +------------------------------------------------------------------- Old: ---- network-3.2.14.0.tar.gz New: ---- network-3.2.16.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-network.spec ++++++ --- /var/tmp/diff_new_pack.OHyNwR/_old 2026-11-27 19:49:22.065900441 +0100 +++ /var/tmp/diff_new_pack.OHyNwR/_new 2026-11-27 19:49:22.074900823 +0100 @@ -20,7 +20,7 @@ %bcond_with ghc_prof %bcond_with tests Name: ghc-%pkg_name -Version: 3.2.14.0 +Version: 3.2.16.0 Release: 0 %global pkgver %pkg_name-%{version} Summary: Low-level networking interface ++++++ network-3.2.14.0.tar.gz -> network-3.2.16.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/network-3.2.14.0/CHANGELOG.md new/network-3.2.16.0/CHANGELOG.md --- old/network-3.2.14.0/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 +++ new/network-3.2.16.0/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,15 @@ # CHANGELOG for network +## Version 3.2.16.0 + +* Export AcceptConn + [#665](https://github.com/haskell/network/pull/665) + +## Version 3.2.15.0 + +* acceptWith: keep to the give-up when another waiter takes the connection + [#663](https://github.com/haskell/network/pull/663) + ## Version 3.2.14.0 * dontfrag for WINE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/network-3.2.14.0/Network/Socket/Options.hsc new/network-3.2.16.0/Network/Socket/Options.hsc --- old/network-3.2.14.0/Network/Socket/Options.hsc 2001-09-09 03:46:40.000000000 +0200 +++ new/network-3.2.16.0/Network/Socket/Options.hsc 2001-09-09 03:46:40.000000000 +0200 @@ -67,6 +67,7 @@ socketOptionBijection :: Bijection SocketOption String socketOptionBijection = [ (UnsupportedSocketOption, "UnsupportedSocketOption") + , (AcceptConn, "AcceptConn") , (Debug, "Debug") , (ReuseAddr, "ReuseAddr") , (SoDomain, "SoDomain") @@ -135,9 +136,12 @@ ---------------------------------------------------------------- #ifdef SOL_SOCKET --- | SO_ACCEPTCONN, read-only +-- | SO_ACCEPTCONN, read-only: 1 if the socket is listening, 0 if not. +-- Unsupported on macOS, whose getsockopt(2) rejects it. +-- +-- @since 3.2.16.0 pattern AcceptConn :: SocketOption -#ifdef SO_ACCEPTCONN +#if defined(SO_ACCEPTCONN) && !defined(__APPLE__) pattern AcceptConn = SockOpt (#const SOL_SOCKET) (#const SO_ACCEPTCONN) #else pattern AcceptConn = SockOpt (-1) (-1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/network-3.2.14.0/Network/Socket/Syscall.hs new/network-3.2.16.0/Network/Socket/Syscall.hs --- old/network-3.2.14.0/Network/Socket/Syscall.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/network-3.2.16.0/Network/Socket/Syscall.hs 2001-09-09 03:46:40.000000000 +0200 @@ -11,12 +11,11 @@ #if defined(mingw32_HOST_OS) import Control.Exception (bracket) -import Foreign (FunPtr) import Foreign.Marshal.Alloc (alloca) import GHC.Conc (asyncDoProc) import Network.Socket.Cbits #else -import Foreign.C.Error (getErrno, eINTR, eINPROGRESS) +import Foreign.C.Error (getErrno, eAGAIN, eINTR, eINPROGRESS, eWOULDBLOCK) import GHC.Conc (threadWaitWrite) #endif @@ -279,6 +278,33 @@ # endif /* HAVE_ADVANCED_SOCKET_FLAGS */ #endif +#if !defined(mingw32_HOST_OS) +-- | 'accept' which does not wait: 'Nothing' if no connection is queued. +acceptNoWait :: SocketAddress sa => Socket -> IO (Maybe (Socket, sa)) +acceptNoWait listing_sock = withNewSocketAddress $ \new_sa sz -> + withFdSocket listing_sock $ \listing_fd -> do + r <- E.bracketOnError (with (fromIntegral sz) $ tryAccept listing_fd new_sa) + (mapM_ c_close) $ mapM $ \new_fd -> do +# ifndef HAVE_ADVANCED_SOCKET_FLAGS + setNonBlockIfNeeded new_fd + setCloseOnExecIfNeeded new_fd +# endif + mkSocket new_fd + forM r $ \new_sock -> (,) new_sock <$> peekSocketAddress new_sa + where + tryAccept fd sa ptr_len = do +# ifdef HAVE_ADVANCED_SOCKET_FLAGS + new_fd <- c_accept4 fd sa ptr_len (sockNonBlock .|. sockCloexec) +# else + new_fd <- c_accept fd sa ptr_len +# endif + if new_fd /= -1 then return (Just new_fd) else do + err <- getErrno + if err == eINTR then tryAccept fd sa ptr_len + else if err == eAGAIN || err == eWOULDBLOCK then return Nothing + else throwSocketError "Network.Socket.accept" +#endif + foreign import CALLCONV unsafe "socket" c_socket :: CInt -> CInt -> CInt -> IO CInt foreign import CALLCONV unsafe "bind" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/network-3.2.14.0/Network/Socket/Wait.hs new/network-3.2.16.0/Network/Socket/Wait.hs --- old/network-3.2.14.0/Network/Socket/Wait.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/network-3.2.16.0/Network/Socket/Wait.hs 2001-09-09 03:46:40.000000000 +0200 @@ -198,7 +198,18 @@ -- -- @since 3.2.10.0 acceptWith :: SocketAddress sa => Socket -> STM a -> IO (Either a (Socket, sa)) +#if defined(mingw32_HOST_OS) acceptWith s giveUp = withReadable s giveUp $ accept s +#else +acceptWith s giveUp = loop + where + -- Another waiter may take the connection first: then wait again, + -- still under the give-up, rather than block in accept. + loop = withReadable s giveUp (acceptNoWait s) >>= \r -> case r of + Left a -> return $ Left a + Right (Just c) -> return $ Right c + Right Nothing -> loop +#endif -- | 'recvBuf' which the caller can give up on. -- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/network-3.2.14.0/Network/Socket.hs new/network-3.2.16.0/Network/Socket.hs --- old/network-3.2.14.0/Network/Socket.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/network-3.2.16.0/Network/Socket.hs 2001-09-09 03:46:40.000000000 +0200 @@ -139,6 +139,7 @@ SocketOption ( SockOpt, UnsupportedSocketOption, + AcceptConn, Debug, ReuseAddr, SoDomain, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/network-3.2.14.0/network.cabal new/network-3.2.16.0/network.cabal --- old/network-3.2.14.0/network.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/network-3.2.16.0/network.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,6 +1,6 @@ cabal-version: 1.18 name: network -version: 3.2.14.0 +version: 3.2.16.0 license: BSD3 license-file: LICENSE maintainer: Kazu Yamamoto, Tamar Christina diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/network-3.2.14.0/tests/Network/SocketSpec.hs new/network-3.2.16.0/tests/Network/SocketSpec.hs --- old/network-3.2.14.0/tests/Network/SocketSpec.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/network-3.2.16.0/tests/Network/SocketSpec.hs 2001-09-09 03:46:40.000000000 +0200 @@ -22,7 +22,9 @@ import GHC.IO.Exception (IOErrorType (NoSuchThing, ResourceVanished)) import System.IO.Error (ioeGetErrorString, ioeGetErrorType, tryIOError) import System.IO.Temp (withSystemTempDirectory) +#if !defined(mingw32_HOST_OS) import System.Posix.Types (Fd(..)) +#endif import Foreign.C.Types () import System.Timeout (timeout) @@ -200,6 +202,16 @@ getSocketOption sock UserTimeout `shouldReturn` 2000 close sock + describe "AcceptConn" $ do + it "tells whether the socket is listening" $ do + when (isSupportedSocketOption AcceptConn) $ do + sock <- socket AF_INET Stream defaultProtocol + bind sock $ SockAddrInet 0 $ tupleToHostAddress (127, 0, 0, 1) + getSocketOption sock AcceptConn `shouldReturn` 0 + listen sock 1 + getSocketOption sock AcceptConn `shouldReturn` 1 + close sock + describe "DontFragment" $ do it "can be set" $ do sock <- socket AF_INET Stream defaultProtocol @@ -478,6 +490,26 @@ connect cli $ SockAddrInet port $ tupleToHostAddress (127, 0, 0, 1) bracket (fst <$> accept sock) close $ \_ -> return () + -- One connection wakes both waiters; the one which finds it taken + -- must still keep to its give-up rather than wait for the next. + it "keeps to the give-up of an accept which another thread beat" $ + withListener $ \sock port -> do + stops <- replicateM 2 $ newTVarIO False + done <- newEmptyMVar + forM_ (zip [0 :: Int ..] stops) $ \(i, stop) -> forkIO $ do + r <- acceptWith sock (check =<< readTVar stop) + case r :: Either () (Socket, SockAddr) of + Left () -> putMVar done (i, False) + Right (s, _) -> close s >> putMVar done (i, True) + threadDelay 100000 + bracket (socket AF_INET Stream defaultProtocol) close $ \cli -> do + connect cli $ SockAddrInet port $ tupleToHostAddress (127, 0, 0, 1) + (winner, True) <- takeMVar done + let loser = 1 - winner + threadDelay 100000 + atomically $ writeTVar (stops !! loser) True + timeout 1000000 (takeMVar done) `shouldReturn` Just (loser, False) + it "tells a socket closed under an accept from other errors" $ do sock <- socket AF_INET Stream defaultProtocol bind sock $ SockAddrInet 0 $ tupleToHostAddress (127, 0, 0, 1) @@ -660,8 +692,10 @@ cmsgidGen :: Gen CmsgId cmsgidGen = biasedGen (\g -> CmsgId <$> g <*> g) cmsgidPatterns arbitrary +#if !defined(mingw32_HOST_OS) genFds :: Gen [Fd] genFds = listOf (Fd <$> arbitrary) +#endif -- pruned lists of pattern synonym values for each type to generate values from @@ -693,7 +727,7 @@ sockoptPatterns :: [SocketOption] sockoptPatterns = nub [UnsupportedSocketOption - ,Debug,ReuseAddr,SoDomain,Type,SoProtocol,SoError,DontRoute + ,AcceptConn,Debug,ReuseAddr,SoDomain,Type,SoProtocol,SoError,DontRoute ,Broadcast,SendBuffer,RecvBuffer,KeepAlive,KeepInit,OOBInline ,TimeToLive,MaxSegment,NoDelay,Cork,Linger,ReusePort ,RecvLowWater,SendLowWater,RecvTimeOut,SendTimeOut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/network-3.2.14.0/tests/Network/Test/Common.hs new/network-3.2.16.0/tests/Network/Test/Common.hs --- old/network-3.2.14.0/tests/Network/Test/Common.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/network-3.2.16.0/tests/Network/Test/Common.hs 2001-09-09 03:46:40.000000000 +0200 @@ -38,7 +38,9 @@ import Network.Socket import System.Directory import System.Timeout (timeout) +#if !defined(mingw32_HOST_OS) import Test.Hspec +#endif serverAddr :: String serverAddr = "127.0.0.1"
