@@ -187,7 +187,7 @@ runSettingsConnectionMaker set getConnMaker app = do
187187 bracket_ onOpen onClose $
188188
189189 -- Actually serve this connection.
190− serveConnection th set ii app conn addr
190+ serveConnection conn ii addr set app
191191 where
192192 -- FIXME: only IOEception is caught. What about other exceptions?
193193 getConnLoop = getConnMaker `E.catch` \(e :: IOException) -> do
@@ -208,11 +208,13 @@ runSettingsConnectionMaker set getConnMaker app = do
208208 f
209209 Just tm -> f tm
210210
211−serveConnection :: T.Handle
212− -> Settings
211+serveConnection :: Connection
213212 -> InternalInfo
214− -> Application -> Connection -> SockAddr-> IO ()
215−serveConnection timeoutHandle settings ii app conn remoteHost' =
213+ -> SockAddr
214+ -> Settings
215+ -> Application
216+ -> IO ()
217+serveConnection conn ii remoteHost' settings app =
216218 recvSendLoop (connSource conn th) `onException` send500
217219 where
218220 th = threadHandle ii
@@ -225,7 +227,7 @@ serveConnection timeoutHandle settings ii app conn remoteHost' =
225227 internalError = responseLBS H.internalServerError500 [(H.hContentType, "text/plain")] "Something went wrong"
226228
227229 recvSendLoop fromClient = do
228− (req, idxhdr, getSource) <- recvRequest conn timeoutHandle remoteHost' fromClient
230+ (req, idxhdr, getSource) <- recvRequest conn th remoteHost' fromClient
229231 case settingsIntercept settings req of
230232 Nothing -> do
231233 -- Let the application run for as long as it wants