Skip to content

Commit c81a8ec

Browse files
authored
Fix inet_addr
This breaks with modern Network libraries and I don't see how it ever worked. getAddrInfo takes an optional port number (or named port) in that argument. "tcp" is not a port. Passing Nothing suffices, since we're just getting the hostAddress and don't care about the port.
1 parent d9cdb9a commit c81a8ec

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Happstack/Server/Internal/Listen.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ listenOnIPv4 ip portm = do
6363

6464
inet_addr :: String -> IO Socket.HostAddress
6565
inet_addr ip = do
66-
addrInfos <- Socket.getAddrInfo (Just Socket.defaultHints) (Just ip) (Just "tcp")
66+
addrInfos <- Socket.getAddrInfo (Just Socket.defaultHints) (Just ip) Nothing
6767
let getHostAddress addrInfo = case Socket.addrAddress addrInfo of
6868
Socket.SockAddrInet _ hostAddress -> Just hostAddress
6969
_ -> Nothing

0 commit comments

Comments
 (0)