@@ -58,8 +58,12 @@ import Network.Socket (fdSocket)
60-- | Creating 'Connection' for plain HTTP based on a given socket.
60-- | Creating 'Connection' for plain HTTP based on a given socket.
61−socketConnection :: Socket -> IO Connection
61+socketConnection :: Settings -> Socket -> IO Connection
62+#if MIN_VERSION_network(3,1,1)
63+socketConnection set s = do
62−socketConnection s = do
65+socketConnection _ s = do
63 bufferPool <- newBufferPool
67 bufferPool <- newBufferPool
64 writeBuf <- allocateBuffer bufferSize
68 writeBuf <- allocateBuffer bufferSize
65 let sendall = Sock.sendAll s
69 let sendall = Sock.sendAll s
@@ -147,7 +151,7 @@ runSettingsSocket set socket app = do
147 setSocketCloseOnExec s
151 setSocketCloseOnExec s
148 -- NoDelay causes an error for AF_UNIX.
152 -- NoDelay causes an error for AF_UNIX.
149 setSocketOption s NoDelay 1 `E.catch` \(E.SomeException _) -> return ()
153 setSocketOption s NoDelay 1 `E.catch` \(E.SomeException _) -> return ()
150− conn <- socketConnection s
154+ conn <- socketConnection set s
151 return (conn, sa)
155 return (conn, sa)
153 closeListenSocket = close socket
157 closeListenSocket = close socket