network 2.3.0.2 → 2.3.0.3
raw patch · 3 files changed
+9/−3 lines, 3 files
Files
- Network.hs +7/−1
- Network/Socket.hsc +1/−1
- network.cabal +1/−1
Network.hs view
@@ -222,11 +222,17 @@ listen' serv = do proto <- getProtocolNumber "tcp"+ -- We should probably specify addrFamily = AF_INET6 and the filter+ -- code below should be removed. AI_ADDRCONFIG is probably not+ -- necessary. But this code is well-tested. So, let's keep it. let hints = defaultHints { addrFlags = [AI_ADDRCONFIG, AI_PASSIVE] , addrSocketType = Stream , addrProtocol = proto } addrs <- getAddrInfo (Just hints) Nothing (Just serv)- let addr = head addrs+ -- Choose an IPv6 socket if exists. This ensures the socket can+ -- handle both IPv4 and IPv6 if v6only is false.+ let addrs' = filter (\x -> addrFamily x == AF_INET6) addrs+ addr = if null addrs' then head addrs else head addrs' bracketOnError (socket (addrFamily addr) (addrSocketType addr) (addrProtocol addr)) (sClose)
Network/Socket.hsc view
@@ -1042,7 +1042,7 @@ return (pid, uid, gid) #endif -##if !MIN_VERSION_base(4,3,1)+##if !(MIN_VERSION_base(4,3,1)) closeFdWith closer fd = closer fd ##endif
network.cabal view
@@ -1,5 +1,5 @@ name: network-version: 2.3.0.2+version: 2.3.0.3 license: BSD3 license-file: LICENSE maintainer: Johan Tibell <johan.tibell@gmail.com>