on master help sign in
Each request runs in its own ResourceT
c82539fMichael Snoyman
warp/Network/Wai/Handler/Warp/Run.hs+2−1
@@ -8,6 +8,7 @@ import Control.Concurrent (forkIO, threadDelay)
8import Control.Exception
8import Control.Exception
9import Control.Monad (forever, when, unless, void)
9import Control.Monad (forever, when, unless, void)
10import Control.Monad.IO.Class (MonadIO, liftIO)
10import Control.Monad.IO.Class (MonadIO, liftIO)
11+import Control.Monad.Trans.Class (lift)
11import Data.ByteString (ByteString)
12import Data.ByteString (ByteString)
12import qualified Data.ByteString as S
13import qualified Data.ByteString as S
13import Data.Conduit
14import Data.Conduit
@@ -176,7 +177,7 @@ serveConnection settings cleaner port app conn remoteHost' =
176 Nothing -> do
177 Nothing -> do
177 -- Let the application run for as long as it wants
178 -- Let the application run for as long as it wants
178 liftIO $ T.pause th
179 liftIO $ T.pause th
179− res <- app env
180+ res <- lift $ runResourceT $ app env
180
181
181 liftIO $ T.resume th
182 liftIO $ T.resume th
182 keepAlive <- sendResponse cleaner env conn res
183 keepAlive <- sendResponse cleaner env conn res
warp/warp.cabal+1−1
@@ -1,5 +1,5 @@
1Name: warp
1Name: warp
2−Version: 1.3.2
2+Version: 1.3.3
3Synopsis: A fast, light-weight web server for WAI applications.
3Synopsis: A fast, light-weight web server for WAI applications.
4License: MIT
4License: MIT
5License-file: LICENSE
5License-file: LICENSE