on master help sign in
Silence warning in socketConnection
ea4fbcdflip111
warp-tls/Network/Wai/Handler/WarpTLS.hs+2−2
@@ -483,9 +483,9 @@ tryIO = try
483----------------------------------------------------------------
483----------------------------------------------------------------
484
484
485plainHTTP :: TLSSettings -> Settings -> Socket -> S.ByteString -> IO (Connection, Transport)
485plainHTTP :: TLSSettings -> Settings -> Socket -> S.ByteString -> IO (Connection, Transport)
486−plainHTTP TLSSettings{..} _ s bs0 = case onInsecure of
486+plainHTTP TLSSettings{..} set s bs0 = case onInsecure of
487 AllowInsecure -> do
487 AllowInsecure -> do
488− conn' <- socketConnection s
488+ conn' <- socketConnection set s
489 cachedRef <- I.newIORef bs0
489 cachedRef <- I.newIORef bs0
490 let conn'' = conn'
490 let conn'' = conn'
491 { connRecv = recvPlain cachedRef (connRecv conn')
491 { connRecv = recvPlain cachedRef (connRecv conn')
warp/Network/Wai/Handler/Warp/Run.hs+7−3
@@ -58,8 +58,12 @@ import Network.Socket (fdSocket)
58#endif
58#endif
59
59
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
64+#else
62−socketConnection s = do
65+socketConnection _ s = do
66+#endif
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)
152
156
153 closeListenSocket = close socket
157 closeListenSocket = close socket