@@ -187,7 +187,7 @@ runSettingsConnectionMaker set getConnMaker app = do
187 bracket_ onOpen onClose $
187 bracket_ onOpen onClose $
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
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
209 Just tm -> f tm
209 Just tm -> f tm
211−serveConnection :: T.Handle
211+serveConnection :: Connection
213 -> InternalInfo
212 -> InternalInfo
214− -> Application -> Connection -> SockAddr-> IO ()
213+ -> SockAddr
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
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"
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