on master help sign in
warp: Allow sending response while consuming request (#78)
commit533c41d999790858a5d94375a3bd147e379dd509 authorMichael Snoyman <michael@snoyman.com> dateSun 1 Jul 2012, 10:14 (14 years ago) parent9540e02
1 file changed+3−2
warp/Network/Wai/Handler/Warp.hs+3−2
warp/Network/Wai/Handler/Warp.hs+3−2
@@ -312,12 +312,13 @@ serveConnection settings th port app conn remoteHost' =
312312 liftIO $ T.pause th
313313 res <- app env
314314
315+ liftIO $ T.resume th
316+ keepAlive <- sendResponse th env conn res
317+
315318 -- flush the rest of the request body
316319 requestBody env $$ CL.sinkNull
317320 ResumableSource fromClient' _ <- liftIO getSource
318321
319− liftIO $ T.resume th
320− keepAlive <- sendResponse th env conn res
321322 when keepAlive $ serveConnection'' fromClient'
322323 Just intercept -> do
323324 liftIO $ T.pause th