network 2.6.3.1 → 2.6.3.2
raw patch · 17 files changed
+416/−226 lines, 17 filesdep ~base
Dependency ranges changed: base
Files
- CHANGELOG.md +26/−0
- Network.hs +16/−16
- Network/BSD.hsc +28/−18
- Network/Socket.hsc +60/−37
- Network/Socket/ByteString.hsc +11/−29
- Network/Socket/Internal.hsc +2/−1
- Network/Socket/Types.hsc +15/−7
- README.md +11/−2
- config.guess +115/−69
- config.sub +70/−24
- configure +22/−10
- configure.ac +1/−1
- include/HsNet.h +3/−3
- include/HsNetworkConfig.h +2/−2
- network.cabal +2/−2
- tests/Regression.hs +0/−3
- tests/Simple.hs +32/−2
CHANGELOG.md view
@@ -1,3 +1,29 @@+## Version 2.6.3.2++ * Zero memory of `sockaddr_un` if abstract socket+ [#220](https://github.com/haskell/network/pull/220)++ * Improving error messages+ [#232](https://github.com/haskell/network/pull/232)++ * Allow non-blocking file descriptors via `setNonBlockIfNeeded`+ [#242](https://github.com/haskell/network/pull/242)++ * Update config.{guess,sub} to latest version+ [#244](https://github.com/haskell/network/pull/244)++ * Rename `my_inet_ntoa` to avoid symbol conflicts+ [#228](https://github.com/haskell/network/pull/228)++ * Test infrastructure improvements+ [#219](https://github.com/haskell/network/pull/219)+ [#217](https://github.com/haskell/network/pull/217)+ [#218](https://github.com/haskell/network/pull/218)++ * House keeping and cleanup+ [#238](https://github.com/haskell/network/pull/238)+ [#237](https://github.com/haskell/network/pull/237)+ ## Version 2.6.3.1 * Reverse breaking exception change in `Network.Socket.ByteString.recv`
Network.hs view
@@ -59,7 +59,6 @@ {-$performance-} ) where -import Control.Exception (throwIO) import Control.Monad (liftM) import Data.Maybe (fromJust) import Network.BSD@@ -98,9 +97,9 @@ #if defined(IPV6_SOCKET_SUPPORT) -- IPv6 and IPv4. -connectTo hostname (Service serv) = connect' hostname serv+connectTo hostname (Service serv) = connect' "Network.connectTo" hostname serv -connectTo hostname (PortNumber port) = connect' hostname (show port)+connectTo hostname (PortNumber port) = connect' "Network.connectTo" hostname (show port) #else -- IPv4 only. @@ -140,15 +139,15 @@ #endif #if defined(IPV6_SOCKET_SUPPORT)-connect' :: HostName -> ServiceName -> IO Handle+connect' :: String -> HostName -> ServiceName -> IO Handle -connect' host serv = do+connect' caller host serv = do proto <- getProtocolNumber "tcp" let hints = defaultHints { addrFlags = [AI_ADDRCONFIG] , addrProtocol = proto , addrSocketType = Stream } addrs <- getAddrInfo (Just hints) (Just host) (Just serv)- firstSuccessful $ map tryToConnect addrs+ firstSuccessful caller $ map tryToConnect addrs where tryToConnect addr = bracketOnError@@ -291,14 +290,14 @@ SockAddrInet _ a -> inet_ntoa a SockAddrInet6 _ _ a _ -> return (show a) #if defined(mingw32_HOST_OS)- SockAddrUnix {} -> throwIO $ userError "accept: socket address not supported on this platform."+ SockAddrUnix {} -> ioError $ userError "Network.accept: peer socket address 'SockAddrUnix' not supported on this platform." #else SockAddrUnix a -> return a #endif #if defined(CAN_SOCKET_SUPPORT)- SockAddrCan {} -> throwIO $ userError "accept: unsupported for CAN peer."+ SockAddrCan {} -> ioError $ userError "Network.accept: peer socket address 'SockAddrCan' not supported." #else- SockAddrCan {} -> throwIO $ userError "accept: socket address not supported on this platform."+ SockAddrCan {} -> ioError $ userError "Network.accept: peer socket address 'SockAddrCan' not supported on this platform." #endif handle <- socketToHandle sock' ReadWriteMode let port = case addr of@@ -314,7 +313,8 @@ return (handle, path, -1) #endif accept (MkSocket _ family _ _ _) =- error $ "Sorry, address family " ++ (show family) ++ " is not supported!"+ ioError $ userError $ "Network.accept: address family '" +++ show family ++ "' not supported." -- | Close the socket. Sending data to or receiving data from closed socket@@ -405,14 +405,14 @@ #if defined(IPV6_SOCKET_SUPPORT) SockAddrInet6 port _ _ _ -> return $ PortNumber port #else- SockAddrInet6 {} -> throwIO $ userError "socketPort: socket address not supported on this platform."+ SockAddrInet6 {} -> ioError $ userError "Network.socketPort: socket address 'SockAddrInet6' not supported on this platform." #endif #if defined(mingw32_HOST_OS)- SockAddrUnix {} -> throwIO $ userError "socketPort: socket address not supported on this platform."+ SockAddrUnix {} -> ioError $ userError "Network.socketPort: socket address 'SockAddrUnix' not supported on this platform." #else SockAddrUnix path -> return $ UnixSocket path #endif- SockAddrCan {} -> throwIO $ userError "socketPort: CAN address not supported."+ SockAddrCan {} -> ioError $ userError "Network.socketPort: socket address 'SockAddrCan' not supported." -- --------------------------------------------------------------------------- -- Utils@@ -463,8 +463,8 @@ -- The operations are run outside of the catchIO cleanup handler because -- catchIO masks asynchronous exceptions in the cleanup handler. -- In the case of complete failure, the last exception is actually thrown.-firstSuccessful :: [IO a] -> IO a-firstSuccessful = go Nothing+firstSuccessful :: String -> [IO a] -> IO a+firstSuccessful caller = go Nothing where -- Attempt the next operation, remember exception on failure go _ (p:ps) =@@ -474,5 +474,5 @@ Left e -> go (Just e) ps -- All operations failed, throw error if one exists- go Nothing [] = error "firstSuccessful: empty list"+ go Nothing [] = ioError $ userError $ caller ++ ": firstSuccessful: empty list" go (Just e) [] = Exception.throwIO e
Network/BSD.hsc view
@@ -168,7 +168,7 @@ serviceProtocol = s_proto }) - poke _p = error "Storable.poke(BSD.ServiceEntry) not implemented"+ poke = throwUnsupportedOperationPoke "ServiceEntry" -- | Get service by name.@@ -178,7 +178,7 @@ getServiceByName name proto = withLock $ do withCString name $ \ cstr_name -> do withCString proto $ \ cstr_proto -> do- throwNoSuchThingIfNull "getServiceByName" "no such service entry"+ throwNoSuchThingIfNull "Network.BSD.getServiceByName" "no such service entry" $ c_getservbyname cstr_name cstr_proto >>= peek @@ -189,7 +189,7 @@ getServiceByPort :: PortNumber -> ProtocolName -> IO ServiceEntry getServiceByPort port proto = withLock $ do withCString proto $ \ cstr_proto -> do- throwNoSuchThingIfNull "getServiceByPort" "no such service entry"+ throwNoSuchThingIfNull "Network.BSD.getServiceByPort" "no such service entry" $ c_getservbyport (fromIntegral port) cstr_proto >>= peek @@ -205,7 +205,7 @@ #if !defined(mingw32_HOST_OS) getServiceEntry :: IO ServiceEntry getServiceEntry = withLock $ do- throwNoSuchThingIfNull "getServiceEntry" "no such service entry"+ throwNoSuchThingIfNull "Network.BSD.getServiceEntry" "no such service entry" $ c_getservent >>= peek @@ -270,12 +270,13 @@ protoNumber = p_proto }) - poke _p = error "Storable.poke(BSD.ProtocolEntry) not implemented"+ poke = throwUnsupportedOperationPoke "ProtocolEntry" + getProtocolByName :: ProtocolName -> IO ProtocolEntry getProtocolByName name = withLock $ do withCString name $ \ name_cstr -> do- throwNoSuchThingIfNull "getProtocolByName" ("no such protocol name: " ++ name)+ throwNoSuchThingIfNull "Network.BSD.getProtocolByName" ("no such protocol name: " ++ name) $ c_getprotobyname name_cstr >>= peek @@ -285,7 +286,7 @@ getProtocolByNumber :: ProtocolNumber -> IO ProtocolEntry getProtocolByNumber num = withLock $ do- throwNoSuchThingIfNull "getProtocolByNumber" ("no such protocol number: " ++ show num)+ throwNoSuchThingIfNull "Network.BSD.getProtocolByNumber" ("no such protocol number: " ++ show num) $ c_getprotobynumber (fromIntegral num) >>= peek @@ -301,7 +302,7 @@ #if !defined(mingw32_HOST_OS) getProtocolEntry :: IO ProtocolEntry -- Next Protocol Entry from DB getProtocolEntry = withLock $ do- ent <- throwNoSuchThingIfNull "getProtocolEntry" "no such protocol entry"+ ent <- throwNoSuchThingIfNull "Network.BSD.getProtocolEntry" "no such protocol entry" $ c_getprotoent peek ent @@ -359,14 +360,14 @@ hostAddresses = h_addr_list }) - poke _p = error "Storable.poke(BSD.ServiceEntry) not implemented"+ poke = throwUnsupportedOperationPoke "HostEntry" -- convenience function: hostAddress :: HostEntry -> HostAddress hostAddress (HostEntry nm _ _ ls) = case ls of- [] -> error ("BSD.hostAddress: empty network address list for " ++ nm)+ [] -> error $ "Network.BSD.hostAddress: empty network address list for " ++ nm (x:_) -> x -- getHostByName must use the same lock as the *hostent functions@@ -376,7 +377,7 @@ getHostByName :: HostName -> IO HostEntry getHostByName name = withLock $ do withCString name $ \ name_cstr -> do- ent <- throwNoSuchThingIfNull "getHostByName" "no such host entry"+ ent <- throwNoSuchThingIfNull "Network.BSD.getHostByName" "no such host entry" $ c_gethostbyname name_cstr peek ent @@ -390,7 +391,7 @@ getHostByAddr :: Family -> HostAddress -> IO HostEntry getHostByAddr family addr = do with addr $ \ ptr_addr -> withLock $ do- throwNoSuchThingIfNull "getHostByAddr" "no such host entry"+ throwNoSuchThingIfNull "Network.BSD.getHostByAddr" "no such host entry" $ c_gethostbyaddr ptr_addr (fromIntegral (sizeOf addr)) (packFamily family) >>= peek @@ -400,7 +401,7 @@ #if defined(HAVE_GETHOSTENT) && !defined(mingw32_HOST_OS) getHostEntry :: IO HostEntry getHostEntry = withLock $ do- throwNoSuchThingIfNull "getHostEntry" "unable to retrieve host entry"+ throwNoSuchThingIfNull "Network.BSD.getHostEntry" "unable to retrieve host entry" $ c_gethostent >>= peek @@ -460,14 +461,14 @@ networkAddress = n_net }) - poke _p = error "Storable.poke(BSD.NetEntry) not implemented"+ poke = throwUnsupportedOperationPoke "NetworkEntry" #if !defined(mingw32_HOST_OS) getNetworkByName :: NetworkName -> IO NetworkEntry getNetworkByName name = withLock $ do withCString name $ \ name_cstr -> do- throwNoSuchThingIfNull "getNetworkByName" "no such network entry"+ throwNoSuchThingIfNull "Network.BSD.getNetworkByName" "no such network entry" $ c_getnetbyname name_cstr >>= peek @@ -476,7 +477,7 @@ getNetworkByAddr :: NetworkAddr -> Family -> IO NetworkEntry getNetworkByAddr addr family = withLock $ do- throwNoSuchThingIfNull "getNetworkByAddr" "no such network entry"+ throwNoSuchThingIfNull "Network.BSD.getNetworkByAddr" "no such network entry" $ c_getnetbyaddr addr (packFamily family) >>= peek @@ -485,7 +486,7 @@ getNetworkEntry :: IO NetworkEntry getNetworkEntry = withLock $ do- throwNoSuchThingIfNull "getNetworkEntry" "no more network entries"+ throwNoSuchThingIfNull "Network.BSD.getNetworkEntry" "no more network entries" $ c_getnetent >>= peek @@ -549,7 +550,7 @@ getHostName = do let size = 256 allocaArray0 size $ \ cstr -> do- throwSocketErrorIfMinus1_ "getHostName" $ c_gethostname cstr (fromIntegral size)+ throwSocketErrorIfMinus1_ "Network.BSD.getHostName" $ c_gethostname cstr (fromIntegral size) peekCString cstr foreign import CALLCONV unsafe "gethostname"@@ -577,3 +578,12 @@ if (ptr == nullPtr) then ioError (ioeSetErrorString (mkIOError NoSuchThing loc Nothing Nothing) desc) else return ptr++throwUnsupportedOperationPoke :: String -> Ptr a -> a -> IO ()+throwUnsupportedOperationPoke typ _ _ =+ ioError $ ioeSetErrorString ioe "Operation not implemented"+ where+ ioe = mkIOError UnsupportedOperation+ ("Network.BSD: instance Storable " ++ typ ++ ": poke")+ Nothing+ Nothing
Network/Socket.hsc view
@@ -160,6 +160,7 @@ -- in case you ever want to get at the underlying file descriptor.. , fdSocket , mkSocket+ , setNonBlockIfNeeded -- * Deprecated aliases -- $deprecated-aliases@@ -262,6 +263,10 @@ FD{fdFD = fd,fdIsSocket_ = 1} #endif +-- | Smart constructor for constructing a 'Socket'. It should only be+-- called once for every new file descriptor. The caller must make+-- sure that the socket is in non-blocking mode. See+-- 'setNonBlockIfNeeded'. mkSocket :: CInt -> Family -> SocketType@@ -339,7 +344,7 @@ -> IO Socket -- Unconnected Socket socket family stype protocol = do c_stype <- packSocketTypeOrThrow "socket" stype- fd <- throwSocketErrorIfMinus1Retry "socket" $+ fd <- throwSocketErrorIfMinus1Retry "Network.Socket.socket" $ c_socket (packFamily family) c_stype protocol setNonBlockIfNeeded fd socket_status <- newMVar NotConnected@@ -372,7 +377,7 @@ socketPair family stype protocol = do allocaBytes (2 * sizeOf (1 :: CInt)) $ \ fdArr -> do c_stype <- packSocketTypeOrThrow "socketPair" stype- _rc <- throwSocketErrorIfMinus1Retry "socketpair" $+ _rc <- throwSocketErrorIfMinus1Retry "Network.Socket.socketpair" $ c_socketpair (packFamily family) c_stype protocol fdArr [fd1,fd2] <- peekArray 2 fdArr s1 <- mkNonBlockingSocket fd1@@ -390,6 +395,9 @@ #endif -- | Set the socket to nonblocking, if applicable to this platform.+--+-- Depending on the platform this is required when using sockets from file+-- descriptors that are passed in through 'recvFd' or other means. setNonBlockIfNeeded :: CInt -> IO () setNonBlockIfNeeded fd = System.Posix.Internals.setNonBlockingFD fd True@@ -409,11 +417,12 @@ modifyMVar_ socketStatus $ \ status -> do if status /= NotConnected then- ioError (userError ("bind: can't peform bind on socket in status " ++- show status))+ ioError $ userError $+ "Network.Socket.bind: can't bind to socket with status " ++ show status else do withSockAddr addr $ \p_addr sz -> do- _status <- throwSocketErrorIfMinus1Retry "bind" $ c_bind s p_addr (fromIntegral sz)+ _status <- throwSocketErrorIfMinus1Retry "Network.Socket.bind" $+ c_bind s p_addr (fromIntegral sz) return Bound -----------------------------------------------------------------------------@@ -427,8 +436,8 @@ modifyMVar_ socketStatus $ \currentStatus -> do if currentStatus /= NotConnected && currentStatus /= Bound then- ioError (userError ("connect: can't peform connect on socket in status " ++- show currentStatus))+ ioError $ userError $+ errLoc ++ ": can't connect to socket with status " ++ show currentStatus else do withSockAddr addr $ \p_addr sz -> do @@ -442,9 +451,9 @@ _ | err == eINTR -> connectLoop _ | err == eINPROGRESS -> connectBlocked -- _ | err == eAGAIN -> connectBlocked- _otherwise -> throwSocketError "connect"+ _otherwise -> throwSocketError errLoc #else- throwSocketError "connect"+ throwSocketError errLoc #endif else return () @@ -453,10 +462,12 @@ err <- getSocketOption sock SoError if (err == 0) then return ()- else throwSocketErrorCode "connect" (fromIntegral err)+ else throwSocketErrorCode errLoc (fromIntegral err) connectLoop return Connected+ where+ errLoc = "Network.Socket.connect: " ++ show sock ----------------------------------------------------------------------------- -- Listen@@ -471,10 +482,11 @@ modifyMVar_ socketStatus $ \ status -> do if status /= Bound then- ioError (userError ("listen: can't peform listen on socket in status " ++- show status))+ ioError $ userError $+ "Network.Socket.listen: can't listen on socket with status " ++ show status else do- throwSocketErrorIfMinus1Retry_ "listen" (c_listen s (fromIntegral backlog))+ throwSocketErrorIfMinus1Retry_ "Network.Socket.listen" $+ c_listen s (fromIntegral backlog) return Listening -----------------------------------------------------------------------------@@ -500,8 +512,10 @@ okay <- isAcceptable sock if not okay then- ioError (userError ("accept: can't perform accept on socket (" ++ (show (family,stype,protocol)) ++") in status " ++- show currentStatus))+ ioError $ userError $+ "Network.Socket.accept: can't accept socket (" +++ show (family, stype, protocol) ++ ") with status " +++ show currentStatus else do let sz = sizeOfSockAddrByFamily family allocaBytes sz $ \ sockaddr -> do@@ -522,11 +536,11 @@ #else with (fromIntegral sz) $ \ ptr_len -> do # ifdef HAVE_ACCEPT4- new_sock <- throwSocketErrorIfMinus1RetryMayBlock "accept"+ new_sock <- throwSocketErrorIfMinus1RetryMayBlock "Network.Socket.accept" (threadWaitRead (fromIntegral s)) (c_accept4 s sockaddr ptr_len (#const SOCK_NONBLOCK)) # else- new_sock <- throwSocketErrorWaitRead sock "accept"+ new_sock <- throwSocketErrorWaitRead sock "Network.Socket.accept" (c_accept s sockaddr ptr_len) setNonBlockIfNeeded new_sock # endif /* HAVE_ACCEPT4 */@@ -547,7 +561,7 @@ #endif -------------------------------------------------------------------------------- ** Sending and reciving data+-- ** Sending and receiving data -- $sendrecv --@@ -587,7 +601,7 @@ sendBufTo sock@(MkSocket s _family _stype _protocol _status) ptr nbytes addr = do withSockAddr addr $ \p_addr sz -> do liftM fromIntegral $- throwSocketErrorWaitWrite sock "sendTo" $+ throwSocketErrorWaitWrite sock "Network.Socket.sendTo" $ c_sendto s ptr (fromIntegral $ nbytes) 0{-flags-} p_addr (fromIntegral sz) @@ -622,7 +636,7 @@ withNewSockAddr family $ \ptr_addr sz -> do alloca $ \ptr_len -> do poke ptr_len (fromIntegral sz)- len <- throwSocketErrorWaitRead sock "recvFrom" $+ len <- throwSocketErrorWaitRead sock "Network.Socket.recvFrom" $ c_recvfrom s ptr (fromIntegral nbytes) 0{-flags-} ptr_addr ptr_len let len' = fromIntegral len@@ -678,7 +692,7 @@ 0 (fromIntegral len) #else- throwSocketErrorWaitWrite sock "sendBuf" $+ throwSocketErrorWaitWrite sock "Network.Socket.sendBuf" $ c_send s str (fromIntegral len) 0{-flags-} #endif @@ -732,7 +746,7 @@ readRawBufferPtr "Network.Socket.recvBuf" (socket2FD sock) ptr 0 (fromIntegral nbytes) #else- throwSocketErrorWaitRead sock "recvBuf" $+ throwSocketErrorWaitRead sock "Network.Socket.recvBuf" $ c_recv s (castPtr ptr) (fromIntegral nbytes) 0{-flags-} #endif let len' = fromIntegral len@@ -759,7 +773,9 @@ return port #endif socketPort (MkSocket _ family _ _ _) =- ioError (userError ("socketPort: not supported for Family " ++ show family))+ ioError $ userError $+ "Network.Socket.socketPort: address family '" ++ show family +++ "' not supported." -- ---------------------------------------------------------------------------@@ -775,7 +791,8 @@ getPeerName (MkSocket s family _ _ _) = do withNewSockAddr family $ \ptr sz -> do with (fromIntegral sz) $ \int_star -> do- throwSocketErrorIfMinus1Retry_ "getPeerName" $ c_getpeername s ptr int_star+ throwSocketErrorIfMinus1Retry_ "Network.Socket.getPeerName" $+ c_getpeername s ptr int_star _sz <- peek int_star peekSockAddr ptr @@ -783,7 +800,8 @@ getSocketName (MkSocket s family _ _ _) = do withNewSockAddr family $ \ptr sz -> do with (fromIntegral sz) $ \int_star -> do- throwSocketErrorIfMinus1Retry_ "getSocketName" $ c_getsockname s ptr int_star+ throwSocketErrorIfMinus1Retry_ "Network.Socket.getSocketName" $+ c_getsockname s ptr int_star peekSockAddr ptr -----------------------------------------------------------------------------@@ -938,7 +956,7 @@ setSocketOption (MkSocket s _ _ _ _) so v = do (level, opt) <- packSocketOption' "setSocketOption" so with (fromIntegral v) $ \ptr_v -> do- throwSocketErrorIfMinus1_ "setSocketOption" $+ throwSocketErrorIfMinus1_ "Network.Socket.setSocketOption" $ c_setsockopt s level opt ptr_v (fromIntegral (sizeOf (undefined :: CInt))) return ()@@ -953,7 +971,7 @@ (level, opt) <- packSocketOption' "getSocketOption" so alloca $ \ptr_v -> with (fromIntegral (sizeOf (undefined :: CInt))) $ \ptr_sz -> do- throwSocketErrorIfMinus1Retry_ "getSocketOption" $+ throwSocketErrorIfMinus1Retry_ "Network.Socket.getSocketOption" $ c_getsockopt s level opt ptr_v ptr_sz fromIntegral `liftM` peek ptr_v @@ -971,7 +989,7 @@ let sz = (#const sizeof(struct ucred)) allocaBytes sz $ \ ptr_cr -> with (fromIntegral sz) $ \ ptr_sz -> do- _ <- ($) throwSocketErrorIfMinus1Retry "getPeerCred" $+ _ <- ($) throwSocketErrorIfMinus1Retry "Network.Socket.getPeerCred" $ c_getsockopt fd (#const SOL_SOCKET) (#const SO_PEERCRED) ptr_cr ptr_sz pid <- (#peek struct ucred, pid) ptr_cr uid <- (#peek struct ucred, uid) ptr_cr@@ -990,7 +1008,7 @@ let fd = fdSocket sock alloca $ \ ptr_uid -> alloca $ \ ptr_gid -> do- throwSocketErrorIfMinus1Retry_ "getPeerEid" $+ throwSocketErrorIfMinus1Retry_ "Network.Socket.getPeerEid" $ c_getpeereid fd ptr_uid ptr_gid uid <- peek ptr_uid gid <- peek ptr_gid@@ -1007,15 +1025,18 @@ -- for transmitting file descriptors, mainly. sendFd :: Socket -> CInt -> IO () sendFd sock outfd = do- _ <- ($) throwSocketErrorWaitWrite sock "sendFd" $+ _ <- ($) throwSocketErrorWaitWrite sock "Network.Socket.sendFd" $ c_sendFd (fdSocket sock) outfd -- Note: If Winsock supported FD-passing, thi would have been -- incorrect (since socket FDs need to be closed via closesocket().) closeFd outfd +-- | Receive a file descriptor over a domain socket. Note that the resulting+-- file descriptor may have to be put into non-blocking mode in order to be+-- used safely. See 'setNonBlockIfNeeded'. recvFd :: Socket -> IO CInt recvFd sock = do- theFd <- throwSocketErrorWaitRead sock "recvFd" $+ theFd <- throwSocketErrorWaitRead sock "Network.Socket.recvFd" $ c_recvFd (fdSocket sock) return theFd @@ -1084,7 +1105,8 @@ -- 'ShutdownBoth', further sends and receives are disallowed. shutdown :: Socket -> ShutdownCmd -> IO () shutdown (MkSocket s _ _ _ _) stype = do- throwSocketErrorIfMinus1Retry_ "shutdown" (c_shutdown s (sdownCmdToInt stype))+ throwSocketErrorIfMinus1Retry_ "Network.Socket.shutdown" $+ c_shutdown s (sdownCmdToInt stype) return () -- -----------------------------------------------------------------------------@@ -1153,7 +1175,8 @@ withCString ipstr $ \str -> do had <- c_inet_addr str if had == -1- then ioError (userError ("inet_addr: Malformed address: " ++ ipstr))+ then ioError $ userError $+ "Network.Socket.inet_addr: Malformed address: " ++ ipstr else return had -- network byte order inet_ntoa :: HostAddress -> IO String@@ -1443,7 +1466,7 @@ return ais _ -> do err <- gai_strerror ret ioError (ioeSetErrorString- (mkIOError NoSuchThing "getAddrInfo" Nothing+ (mkIOError NoSuchThing "Network.Socket.getAddrInfo" Nothing Nothing) err) -- Leaving out the service and using AI_NUMERICSERV causes a -- segfault on OS X 10.8.2. This code removes AI_NUMERICSERV@@ -1480,7 +1503,7 @@ foreign import ccall safe "gai_strerror" c_gai_strerror :: CInt -> IO CString #else-gai_strerror n = return ("error " ++ show n)+gai_strerror n = ioError $ userError $ "Network.Socket.gai_strerror not supported: " ++ show n #endif withCStringIf :: Bool -> Int -> (CSize -> CString -> IO a) -> IO a@@ -1523,7 +1546,7 @@ return (host, serv) _ -> do err <- gai_strerror ret ioError (ioeSetErrorString- (mkIOError NoSuchThing "getNameInfo" Nothing+ (mkIOError NoSuchThing "Network.Socket.getNameInfo" Nothing Nothing) err) foreign import ccall safe "hsnet_getnameinfo"@@ -1542,7 +1565,7 @@ -- --------------------------------------------------------------------------- -- foreign imports from the C library -foreign import ccall unsafe "my_inet_ntoa"+foreign import ccall unsafe "hsnet_inet_ntoa" c_inet_ntoa :: HostAddress -> IO (Ptr CChar) foreign import CALLCONV unsafe "inet_addr"
Network/Socket/ByteString.hsc view
@@ -43,14 +43,15 @@ -- $example ) where +import Control.Exception (catch, throwIO) import Control.Monad (when) import Data.ByteString (ByteString) import Data.ByteString.Internal (createAndTrim) import Data.ByteString.Unsafe (unsafeUseAsCStringLen)-import Data.Word (Word8) import Foreign.Marshal.Alloc (allocaBytes)-import Foreign.Ptr (Ptr, castPtr)-import Network.Socket (sendBuf, sendBufTo, recvBufFrom)+import Foreign.Ptr (castPtr)+import Network.Socket (sendBuf, sendBufTo, recvBuf, recvBufFrom)+import System.IO.Error (isEOFError) import qualified Data.ByteString as B @@ -62,22 +63,13 @@ import Control.Monad (liftM, zipWithM_) import Foreign.Marshal.Array (allocaArray) import Foreign.Marshal.Utils (with)-import Foreign.Ptr (plusPtr)+import Foreign.Ptr (Ptr, plusPtr) import Foreign.Storable (Storable(..))-import Foreign.C.Types (CChar, CSize(..), CInt(..)) import Network.Socket.ByteString.IOVec (IOVec(..)) import Network.Socket.ByteString.MsgHdr (MsgHdr(..))--#else-import GHC.IO.FD (FD(..), readRawBufferPtr) #endif -#if !defined(mingw32_HOST_OS)-foreign import CALLCONV unsafe "recv"- c_recv :: CInt -> Ptr CChar -> CSize -> CInt -> IO CInt-#endif- -- ---------------------------------------------------------------------------- -- Sending @@ -175,7 +167,7 @@ where sendManyInner = liftM fromIntegral . withIOVec cs $ \(iovsPtr, iovsLen) ->- throwSocketErrorWaitWrite sock "writev" $+ throwSocketErrorWaitWrite sock "Network.Socket.ByteString.sendMany" $ c_writev (fromIntegral fd) iovsPtr (fromIntegral (min iovsLen (#const IOV_MAX))) #else@@ -206,7 +198,7 @@ addrPtr (fromIntegral addrSize) iovsPtr (fromIntegral iovsLen) with msgHdr $ \msgHdrPtr ->- throwSocketErrorWaitWrite sock "sendmsg" $+ throwSocketErrorWaitWrite sock "Network.Socket.ByteString.sendManyTo" $ c_sendmsg (fromIntegral fd) msgHdrPtr 0 #else sendManyTo sock cs = sendAllTo sock (B.concat cs)@@ -233,20 +225,10 @@ -> IO ByteString -- ^ Data received recv sock nbytes | nbytes < 0 = ioError (mkInvalidRecvArgError "Network.Socket.ByteString.recv")- | otherwise = createAndTrim nbytes $ recvInner sock nbytes--recvInner :: Socket -> Int -> Ptr Word8 -> IO Int-recvInner sock nbytes ptr =- fmap fromIntegral $-#if defined(mingw32_HOST_OS)- throwSocketErrorIfMinus1Retry "Network.Socket.recvBuf" $- readRawBufferPtr "Network.Socket.ByteString.recv" (FD s 1) ptr 0 (fromIntegral nbytes)-#else- throwSocketErrorWaitRead sock "recv" $- c_recv s (castPtr ptr) (fromIntegral nbytes) 0-#endif- where- s = sockFd sock+ | otherwise = createAndTrim nbytes $ \ptr ->+ catch+ (recvBuf sock ptr nbytes)+ (\e -> if isEOFError e then return 0 else throwIO e) -- | Receive data from the socket. The socket need not be in a -- connected state. Returns @(bytes, address)@ where @bytes@ is a
Network/Socket/Internal.hsc view
@@ -266,7 +266,8 @@ -- Use a CAF to make forcing it do initialisation once, but subsequent forces will be cheap withSocketsInit = unsafePerformIO $ do x <- initWinSock- when (x /= 0) $ ioError $ userError "Failed to initialise WinSock"+ when (x /= 0) $ ioError $+ userError "Network.Socket.Internal.withSocketsDo: Failed to initialise WinSock" foreign import ccall unsafe "initWinSock" initWinSock :: IO Int
Network/Socket/Types.hsc view
@@ -59,7 +59,6 @@ ) where import Control.Concurrent.MVar-import Control.Exception (throwIO) import Control.Monad import Data.Bits import Data.Maybe@@ -82,7 +81,8 @@ -- * Status flag -- -- If you are calling the 'MkSocket' constructor directly you should ensure--- you have called 'Network.withSocketsDo'.+-- you have called 'Network.withSocketsDo' and that the file descriptor is+-- in non-blocking mode. See 'Network.Socket.setNonBlockIfNeeded'. data Socket = MkSocket CInt -- File Descriptor@@ -724,8 +724,9 @@ #ifdef AF_CAN (#const AF_CAN) -> AF_CAN #endif- unknown -> error ("Network.Socket.unpackFamily: unknown address " ++- "family " ++ show unknown)+ unknown -> error $+ "Network.Socket.Types.unpackFamily: unknown address family: " +++ show unknown ------------------------------------------------------------------------ -- Port Numbers@@ -892,8 +893,9 @@ #if defined(CAN_SOCKET_SUPPORT) sizeOfSockAddrByFamily AF_CAN = #const sizeof(struct sockaddr_can) #endif-sizeOfSockAddrByFamily family =- error $ "sizeOfSockAddrByFamily: " ++ show family ++ " not supported."+sizeOfSockAddrByFamily family = error $+ "Network.Socket.Types.sizeOfSockAddrByFamily: address family '" +++ show family ++ "' not supported." -- | Use a 'SockAddr' with a function requiring a pointer to a -- 'SockAddr' and the length of that 'SockAddr'.@@ -922,6 +924,10 @@ pokeSockAddr p (SockAddrUnix path) = do #if defined(darwin_HOST_OS) zeroMemory p (#const sizeof(struct sockaddr_un))+#else+ case path of+ ('\0':_) -> zeroMemory p (#const sizeof(struct sockaddr_un))+ _ -> return () #endif #if defined(HAVE_STRUCT_SOCKADDR_SA_LEN) (#poke struct sockaddr_un, sun_len) p ((#const sizeof(struct sockaddr_un)) :: Word8)@@ -990,7 +996,9 @@ ifidx <- (#peek struct sockaddr_can, can_ifindex) p return (SockAddrCan ifidx) #endif- _ -> throwIO $ userError $ "peekSockAddr: " ++ show family ++ " not supported on this platform."+ _ -> ioError $ userError $+ "Network.Socket.Types.peekSockAddr: address family '" +++ show family ++ "' not supported." ------------------------------------------------------------------------
README.md view
@@ -1,10 +1,19 @@ # [`network`](http://hackage.haskell.org/package/network) [](https://travis-ci.org/haskell/network) [](https://ci.appveyor.com/project/eborden/network/branch/master) -- To build this package using Cabal directly from git, you must run `autoreconf` before the usual Cabal build steps (configure/build/install). `autoreconf` is included in the [GNU Autoconf](http://www.gnu.org/software/autoconf/) tools. There is no need to run the `configure` script: the `setup configure` step will do this for you.++## Support Policy++### GHC++`network`'s GHC policy supports 3 [stable](https://downloads.haskell.org/~ghc/8.0.2/docs/html/users_guide/intro.html#ghc-version-numbering-policy) versions. The current stable+version and two previous stable versions are supported.++### Hugs, JHC, UHC++`network` does not officially support these compilers.
config.guess view
@@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name.-# Copyright 1992-2014 Free Software Foundation, Inc.+# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2014-03-23'+timestamp='2017-03-05' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by@@ -24,12 +24,12 @@ # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). #-# Originally written by Per Bothner.+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from:-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess #-# Please send patches with a ChangeLog entry to config-patches@gnu.org.+# Please send patches to <config-patches@gnu.org>. me=`echo "$0" | sed -e 's,.*/,,'`@@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner.-Copyright 1992-2014 Free Software Foundation, Inc.+Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."@@ -168,19 +168,29 @@ # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch"- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \+ /sbin/$sysctl 2>/dev/null || \+ /usr/sbin/$sysctl 2>/dev/null || \+ echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;;+ earmv*)+ arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`+ endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`+ machine=${arch}${endian}-unknown+ ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched- # to ELF recently, or will in the future.+ # to ELF recently (or will in the future) and ABI. case "${UNAME_MACHINE_ARCH}" in+ earm*)+ os=netbsdelf+ ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \@@ -197,6 +207,13 @@ os=netbsd ;; esac+ # Determine ABI tags.+ case "${UNAME_MACHINE_ARCH}" in+ earm*)+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'+ abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`+ ;;+ esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need@@ -207,13 +224,13 @@ release='-gnu' ;; *)- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`+ release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.- echo "${machine}-${os}${release}"+ echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`@@ -223,6 +240,10 @@ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;;+ *:LibertyBSD:*:*)+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`+ echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}+ exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;;@@ -235,6 +256,9 @@ *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;;+ *:Sortix:*:*)+ echo ${UNAME_MACHINE}-unknown-sortix+ exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0)@@ -251,42 +275,42 @@ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)")- UNAME_MACHINE="alpha" ;;+ UNAME_MACHINE=alpha ;; "EV4.5 (21064)")- UNAME_MACHINE="alpha" ;;+ UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)")- UNAME_MACHINE="alpha" ;;+ UNAME_MACHINE=alpha ;; "EV5 (21164)")- UNAME_MACHINE="alphaev5" ;;+ UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)")- UNAME_MACHINE="alphaev56" ;;+ UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)")- UNAME_MACHINE="alphapca56" ;;+ UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)")- UNAME_MACHINE="alphapca57" ;;+ UNAME_MACHINE=alphapca57 ;; "EV6 (21264)")- UNAME_MACHINE="alphaev6" ;;+ UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)")- UNAME_MACHINE="alphaev67" ;;+ UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)")- UNAME_MACHINE="alphaev68" ;;+ UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)")- UNAME_MACHINE="alphaev68" ;;+ UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)")- UNAME_MACHINE="alphaev68" ;;+ UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)")- UNAME_MACHINE="alphaev69" ;;+ UNAME_MACHINE=alphaev69 ;; "EV7 (21364)")- UNAME_MACHINE="alphaev7" ;;+ UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)")- UNAME_MACHINE="alphaev79" ;;+ UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r.- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0@@ -359,16 +383,16 @@ exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build- SUN_ARCH="i386"+ SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers.- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then- SUN_ARCH="x86_64"+ SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`@@ -393,7 +417,7 @@ exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3+ test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE}@@ -579,8 +603,9 @@ else IBM_ARCH=powerpc fi- if [ -x /usr/bin/oslevel ] ; then- IBM_REV=`/usr/bin/oslevel`+ if [ -x /usr/bin/lslpp ] ; then+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |+ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi@@ -617,13 +642,13 @@ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in- 32) HP_ARCH="hppa2.0n" ;;- 64) HP_ARCH="hppa2.0w" ;;- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20+ 32) HP_ARCH=hppa2.0n ;;+ 64) HP_ARCH=hppa2.0w ;;+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi@@ -662,11 +687,11 @@ exit (0); } EOF- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`+ (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac- if [ ${HP_ARCH} = "hppa2.0w" ]+ if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build @@ -679,12 +704,12 @@ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then- HP_ARCH="hppa2.0w"+ HP_ARCH=hppa2.0w else- HP_ARCH="hppa64"+ HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV}@@ -789,14 +814,14 @@ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*)- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)@@ -812,10 +837,11 @@ UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64)- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;- *)- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;+ UNAME_PROCESSOR=x86_64 ;;+ i386)+ UNAME_PROCESSOR=i586 ;; esac+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin@@ -878,7 +904,7 @@ exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix@@ -901,7 +927,7 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*)@@ -932,6 +958,9 @@ crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;;+ e2k:Linux:*:*)+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}+ exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;;@@ -944,6 +973,9 @@ ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;;+ k1om:Linux:*:*)+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}+ exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;;@@ -969,6 +1001,9 @@ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;;+ mips64el:Linux:*:*)+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}+ exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;;@@ -1001,6 +1036,9 @@ ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;;+ riscv32:Linux:*:* | riscv64:Linux:*:*)+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}+ exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;;@@ -1020,7 +1058,7 @@ echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*)- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}+ echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC}@@ -1099,7 +1137,7 @@ # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub- # prints for the "djgpp" host, or else GDB configury will decide that+ # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;;@@ -1248,6 +1286,9 @@ SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;;+ SX-ACE:SUPER-UX:*:*)+ echo sxace-nec-superux${UNAME_RELEASE}+ exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;;@@ -1261,9 +1302,9 @@ UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in@@ -1285,7 +1326,7 @@ exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p`- if test "$UNAME_PROCESSOR" = "x86"; then+ if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi@@ -1303,6 +1344,9 @@ NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;;+ NSX-?:NONSTOP_KERNEL:*:*)+ echo nsx-tandem-nsk${UNAME_RELEASE}+ exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;;@@ -1316,7 +1360,7 @@ # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems.- if test "$cputype" = "386"; then+ if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype"@@ -1358,7 +1402,7 @@ echo i386-pc-xenix exit ;; i*86:skyos:*:*)- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos@@ -1369,23 +1413,25 @@ x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;;+ amd64:Isilon\ OneFS:*:*)+ echo x86_64-unknown-onefs+ exit ;; esac cat >&2 <<EOF $0: unable to guess system type -This script, last modified $timestamp, has failed to recognize-the operating system you are using. It is advised that you-download the most up to date version of the config scripts from+This script (version $timestamp), has failed to recognize the+operating system you are using. If your script is old, overwrite+config.guess and config.sub with the latest versions from: - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess and- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub -If the version you run ($0) is already up to date, please-send the following data and any information you think might be-pertinent to <config-patches@gnu.org> in order to provide the needed-information to handle your system.+If $0 has already been updated, send the following data and any+information you think might be pertinent to config-patches@gnu.org to+provide the necessary information to handle your system. config.guess timestamp = $timestamp
config.sub view
@@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script.-# Copyright 1992-2014 Free Software Foundation, Inc.+# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2014-04-03'+timestamp='2017-04-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by@@ -25,7 +25,7 @@ # of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches with a ChangeLog entry to config-patches@gnu.org.+# Please send patches to <config-patches@gnu.org>. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument.@@ -33,7 +33,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from:-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases@@ -53,8 +53,7 @@ me=`echo "$0" | sed -e 's,.*/,,'` usage="\-Usage: $0 [OPTION] CPU-MFR-OPSYS- $0 [OPTION] ALIAS+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. @@ -68,7 +67,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc.+Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."@@ -117,8 +116,8 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \- knetbsd*-gnu* | netbsd*-gnu* | \- kopensolaris*-gnu* | \+ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \+ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`@@ -255,15 +254,16 @@ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \+ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \- | epiphany \- | fido | fr30 | frv \+ | e2k | epiphany \+ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \- | i370 | i860 | i960 | ia64 \+ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \@@ -283,8 +283,10 @@ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \+ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \+ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \@@ -299,10 +301,12 @@ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \+ | pru \ | pyramid \+ | riscv32 | riscv64 \ | rl78 | rx \ | score \- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \@@ -310,6 +314,8 @@ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \+ | visium \+ | wasm32 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80)@@ -324,6 +330,9 @@ c6x) basic_machine=tic6x-unknown ;;+ leon|leon[3-9])+ basic_machine=sparc-$basic_machine+ ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none@@ -369,17 +378,18 @@ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \+ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \- | elxsi-* \+ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \- | i*86-* | i860-* | i960-* | ia64-* \+ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \@@ -401,8 +411,10 @@ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \+ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \+ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \@@ -418,13 +430,15 @@ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \+ | pru-* \ | pyramid-* \+ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \@@ -432,6 +446,8 @@ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \+ | visium-* \+ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \@@ -508,6 +524,9 @@ basic_machine=i386-pc os=-aros ;;+ asmjs)+ basic_machine=asmjs-unknown+ ;; aux) basic_machine=m68k-apple os=-aux@@ -628,6 +647,14 @@ basic_machine=m68k-bull os=-sysv3 ;;+ e500v[12])+ basic_machine=powerpc-unknown+ os=$os"spe"+ ;;+ e500v[12]-*)+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`+ os=$os"spe"+ ;; ebmon29k) basic_machine=a29k-amd os=-ebmon@@ -769,6 +796,9 @@ basic_machine=m68k-isi os=-sysv ;;+ leon-*|leon[3-9]-*)+ basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`+ ;; m68knommu) basic_machine=m68k-unknown os=-linux@@ -824,6 +854,10 @@ basic_machine=powerpc-unknown os=-morphos ;;+ moxiebox)+ basic_machine=moxie-unknown+ os=-moxiebox+ ;; msdos) basic_machine=i386-pc os=-msdos@@ -916,6 +950,9 @@ nsr-tandem) basic_machine=nsr-tandem ;;+ nsx-tandem)+ basic_machine=nsx-tandem+ ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf@@ -1000,7 +1037,7 @@ ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;;- ppcle | powerpclittle | ppc-le | powerpc-little)+ ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*)@@ -1010,7 +1047,7 @@ ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;;- ppc64le | powerpc64little | ppc64-le | powerpc64-little)+ ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*)@@ -1211,6 +1248,9 @@ basic_machine=a29k-wrs os=-vxworks ;;+ wasm32)+ basic_machine=wasm32-unknown+ ;; w65*) basic_machine=w65-wdc os=-none@@ -1356,27 +1396,28 @@ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \- | -aos* | -aros* \+ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \- | -bitrig* | -openbsd* | -solidbsd* \+ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \- | -chorusos* | -chorusrdb* | -cegcc* \+ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \+ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \- | -uxpv* | -beos* | -mpeix* | -udk* \+ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \+ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*)@@ -1508,6 +1549,8 @@ ;; -nacl*) ;;+ -ios)+ ;; -none) ;; *)@@ -1602,6 +1645,9 @@ ;; sparc-* | *-sun) os=-sunos4.1.1+ ;;+ pru-*)+ os=-elf ;; *-be) os=-beos
configure view
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles.-# Generated by GNU Autoconf 2.69 for Haskell network package 2.3.0.14.+# Generated by GNU Autoconf 2.69 for Haskell network package 2.6.3.1. # # Report bugs to <libraries@haskell.org>. #@@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='Haskell network package' PACKAGE_TARNAME='network'-PACKAGE_VERSION='2.3.0.14'-PACKAGE_STRING='Haskell network package 2.3.0.14'+PACKAGE_VERSION='2.6.3.1'+PACKAGE_STRING='Haskell network package 2.6.3.1' PACKAGE_BUGREPORT='libraries@haskell.org' PACKAGE_URL='' @@ -665,6 +665,7 @@ docdir oldincludedir includedir+runstatedir localstatedir sharedstatedir sysconfdir@@ -736,6 +737,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var'+runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'@@ -988,6 +990,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \+ | --runstate | --runstat | --runsta | --runst | --runs \+ | --run | --ru | --r)+ ac_prev=runstatedir ;;+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \+ | --run=* | --ru=* | --r=*)+ runstatedir=$ac_optarg ;;+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \@@ -1125,7 +1136,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \- libdir localedir mandir+ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes.@@ -1238,7 +1249,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF-\`configure' configures Haskell network package 2.3.0.14 to adapt to many kinds of systems.+\`configure' configures Haskell network package 2.6.3.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1278,6 +1289,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var]+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include]@@ -1303,7 +1315,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in- short | recursive ) echo "Configuration of Haskell network package 2.3.0.14:";;+ short | recursive ) echo "Configuration of Haskell network package 2.6.3.1:";; esac cat <<\_ACEOF @@ -1388,7 +1400,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF-Haskell network package configure 2.3.0.14+Haskell network package configure 2.6.3.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc.@@ -1860,7 +1872,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Haskell network package $as_me 2.3.0.14, which was+It was created by Haskell network package $as_me 2.6.3.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@@@ -4609,7 +4621,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log="-This file was extended by Haskell network package $as_me 2.3.0.14, which was+This file was extended by Haskell network package $as_me 2.6.3.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES@@ -4671,7 +4683,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\-Haskell network package config.status 2.3.0.14+Haskell network package config.status 2.6.3.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\"
configure.ac view
@@ -1,4 +1,4 @@-AC_INIT([Haskell network package], [2.3.0.14], [libraries@haskell.org], [network])+AC_INIT([Haskell network package], [2.6.3.1], [libraries@haskell.org], [network]) ac_includes_default="$ac_includes_default #ifdef HAVE_SYS_SOCKET_H
include/HsNet.h view
@@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------------- *- * Definitions for package `net' which are visible in Haskell land.+ * Definitions for package `network' which are visible in Haskell land. * * ---------------------------------------------------------------------------*/ @@ -118,7 +118,7 @@ #endif /* HAVE_WINSOCK2_H */ INLINE char *-my_inet_ntoa(+hsnet_inet_ntoa( #if defined(HAVE_WINSOCK2_H) u_long addr #elif defined(HAVE_IN_ADDR_T)@@ -129,7 +129,7 @@ unsigned long addr #endif )-{ +{ struct in_addr a; a.s_addr = addr; return inet_ntoa(a);
include/HsNetworkConfig.h view
@@ -160,7 +160,7 @@ #define PACKAGE_NAME "Haskell network package" /* Define to the full name and version of this package. */-#define PACKAGE_STRING "Haskell network package 2.3.0.14"+#define PACKAGE_STRING "Haskell network package 2.6.3.1" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "network"@@ -169,7 +169,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */-#define PACKAGE_VERSION "2.3.0.14"+#define PACKAGE_VERSION "2.6.3.1" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1
network.cabal view
@@ -1,5 +1,5 @@ name: network-version: 2.6.3.1+version: 2.6.3.2 license: BSD3 license-file: LICENSE maintainer: Kazu Yamamoto, Evan Borden@@ -41,7 +41,7 @@ cbits/winSockErr.c homepage: https://github.com/haskell/network bug-reports: https://github.com/haskell/network/issues-tested-with: GHC == 7.0.4, GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.1, GHC == 7.10.2, GHC == 8.0.1+tested-with: GHC == 7.8.4, GHC == 7.10.1, GHC == 7.10.2, GHC == 8.0.1, GHC == 8.0.2 library exposed-modules:
tests/Regression.hs view
@@ -9,8 +9,6 @@ import Test.Framework.Providers.HUnit (testCase) import Test.HUnit (assertFailure) -import qualified Regression.Issue215 as Issue215- ------------------------------------------------------------------------ -- Tests @@ -51,7 +49,6 @@ [ testCase "testGetAddrInfo" testGetAddrInfo , testCase "badRecvShouldThrow" badRecvShouldThrow , testCase "badSendShouldThrow" badSendShouldThrow- , testCase "recvShouldntThrowOnClosedSocket" Issue215.main ] ------------------------------------------------------------------------
tests/Simple.hs view
@@ -12,6 +12,7 @@ import Data.Maybe (fromJust) #endif import Network.Socket hiding (recv, recvFrom, send, sendTo)+import qualified Network.Socket (recv) import Network.Socket.ByteString --- To tests for AF_CAN on Linux, you need to bring up a virtual (or real can@@ -30,7 +31,7 @@ #endif import Test.Framework (Test, defaultMain, testGroup) import Test.Framework.Providers.HUnit (testCase)-import Test.HUnit (Assertion, (@=?))+import Test.HUnit (Assertion, (@=?), assertBool, assertFailure) ------------------------------------------------------------------------ @@ -229,9 +230,35 @@ serverSetup = clientSetup #endif +-- The String version of 'recv' should throw an exception when the remote end+-- has closed the connection, the ByteString version should return an empty+-- ByteString.+testStringEol :: Assertion+testStringEol = tcpTest client close+ where client s = do+ res <- E.try $ Network.Socket.recv s 4096+ case res of+ Left (_ :: IOError) -> return ()+ Right _ -> assertFailure+ "String recv didn't throw an exception on a closed socket"++testByteStringEol :: Assertion+testByteStringEol = tcpTest client close+ where client s = do+ res :: Either IOError C.ByteString <- E.try $ recv s 4096+ res @=? Right S.empty+ ------------------------------------------------------------------------ -- Conversions of IP addresses +testHtonlNtohl :: Assertion+testHtonlNtohl = do+ let addrl = 0xCafeBabe+ addrl @=? (htonl . ntohl) addrl+ addrl @=? (ntohl . htonl) addrl+ assertBool "BE or LE byte order" $+ ntohl addrl `elem` [0xCafeBabe, 0xbebafeca]+ testHostAddressToTuple :: Assertion testHostAddressToTuple = do -- Look up a numeric IPv4 host@@ -287,10 +314,13 @@ , testCase "testUserTimeout" testUserTimeout -- , testCase "testGetPeerCred" testGetPeerCred -- , testCase "testGetPeerEid" testGetPeerEid+ , testCase "testStringEol" testStringEol+ , testCase "testByteStringEol" testByteStringEol #if defined(HAVE_LINUX_CAN_H) , testCase "testCanSend" testCanSend #endif -- conversions of IP addresses+ , testCase "testHtonlNtohl" testHtonlNtohl , testCase "testHostAddressToTuple" testHostAddressToTuple , testCase "testHostAddressToTupleInv" testHostAddressToTupleInv #if defined(IPV6_SOCKET_SUPPORT)@@ -314,7 +344,7 @@ case sockAddr of (SockAddrInet port _) -> return port (SockAddrInet6 port _ _ _) -> return port- _ -> error "getPeerPort: only works with IP sockets"+ _ -> ioError $ userError "getPeerPort: only works with IP sockets" -- | Establish a connection between client and server and then run -- 'clientAct' and 'serverAct', in different threads. Both actions