on master help sign in
chainging the signature of serveConnection.
dc1e6f4Kazu Yamamoto
warp/Network/Wai/Handler/Warp/Run.hs+8−6
@@ -187,7 +187,7 @@ runSettingsConnectionMaker set getConnMaker app = do
187 bracket_ onOpen onClose $
187 bracket_ onOpen onClose $
188
188
189 -- Actually serve this connection.
189 -- Actually serve this connection.
190− serveConnection th set ii app conn addr
190+ serveConnection conn ii addr set app
191 where
191 where
192 -- FIXME: only IOEception is caught. What about other exceptions?
192 -- FIXME: only IOEception is caught. What about other exceptions?
193 getConnLoop = getConnMaker `E.catch` \(e :: IOException) -> do
193 getConnLoop = getConnMaker `E.catch` \(e :: IOException) -> do
@@ -208,11 +208,13 @@ runSettingsConnectionMaker set getConnMaker app = do
208 f
208 f
209 Just tm -> f tm
209 Just tm -> f tm
210
210
211−serveConnection :: T.Handle
211+serveConnection :: Connection
212− -> Settings
213 -> InternalInfo
212 -> InternalInfo
214− -> Application -> Connection -> SockAddr-> IO ()
213+ -> SockAddr
214+ -> Settings
215+ -> Application
216+ -> IO ()
215−serveConnection timeoutHandle settings ii app conn remoteHost' =
217+serveConnection conn ii remoteHost' settings app =
216 recvSendLoop (connSource conn th) `onException` send500
218 recvSendLoop (connSource conn th) `onException` send500
217 where
219 where
218 th = threadHandle ii
220 th = threadHandle ii
@@ -225,7 +227,7 @@ serveConnection timeoutHandle settings ii app conn remoteHost' =
225 internalError = responseLBS H.internalServerError500 [(H.hContentType, "text/plain")] "Something went wrong"
227 internalError = responseLBS H.internalServerError500 [(H.hContentType, "text/plain")] "Something went wrong"
226
228
227 recvSendLoop fromClient = do
229 recvSendLoop fromClient = do
228− (req, idxhdr, getSource) <- recvRequest conn timeoutHandle remoteHost' fromClient
230+ (req, idxhdr, getSource) <- recvRequest conn th remoteHost' fromClient
229 case settingsIntercept settings req of
231 case settingsIntercept settings req of
230 Nothing -> do
232 Nothing -> do
231 -- Let the application run for as long as it wants
233 -- Let the application run for as long as it wants