packages feed

warp 2.1.0 → 2.1.1

raw patch · 4 files changed

+25/−8 lines, 4 files

Files

Network/Wai/Handler/Warp.hs view
@@ -39,6 +39,9 @@   , setFdCacheDuration   , setBeforeMainLoop   , setNoParsePath+    -- ** Getters+  , getPort+  , getHost     -- ** Accessors     -- | Note: these accessors are deprecated, please use the @set@ versions instead.   , settingsPort@@ -186,3 +189,15 @@ -- Since 2.1.0 setNoParsePath :: Bool -> Settings -> Settings setNoParsePath x y = y { settingsNoParsePath = x }++-- | Get the listening port.+--+-- Since 2.1.1+getPort :: Settings -> Int+getPort = settingsPort++-- | Get the interface to bind to.+--+-- Since 2.1.1+getHost :: Settings -> HostPreference+getHost = settingsHost
Network/Wai/Handler/Warp/Response.hs view
@@ -181,7 +181,7 @@         ResponseFile _ _ path mPart -> RspFile path mPart mRange (T.tickle th)         ResponseBuilder _ _ b       -> RspBuilder b needsChunked         ResponseSource _ _ fb       -> RspSource fb needsChunked th-        ResponseRaw raw _           -> RspRaw raw leftover'+        ResponseRaw raw _           -> RspRaw raw leftover' (T.tickle th)     ret = case response of         ResponseFile _ _ _ _  -> isPersist         ResponseBuilder _ _ _ -> isKeepAlive@@ -193,7 +193,7 @@ data Rsp = RspFile FilePath (Maybe FilePart) (Maybe HeaderValue) (IO ())          | RspBuilder Builder Bool          | RspSource (forall b. WithSource IO (Flush Builder) b) Bool T.Handle-         | RspRaw (forall b. WithRawApp b) (Maybe ByteString)+         | RspRaw (forall b. WithRawApp b) (Maybe ByteString) (IO ())  ---------------------------------------------------------------- @@ -249,17 +249,19 @@  ---------------------------------------------------------------- -sendRsp conn _ _ _ restore (RspRaw withApp mbs) =+sendRsp conn _ _ _ restore (RspRaw withApp mbs tickle) =     withApp $ \app -> restore $ app src sink   where-    sink = CL.mapM_ (connSendAll conn)+    sink = CL.mapM_ (\bs -> connSendAll conn bs >> tickle)     src = do         maybe (return ()) yield mbs         loop       where         loop = do             bs <- liftIO $ connRecv conn-            unless (S.null bs) $ yield bs >> loop+            unless (S.null bs) $ do+                liftIO tickle+                yield bs >> loop  ---------------------------------------------------------------- 
test/RunSpec.hs view
@@ -77,14 +77,14 @@     port <- I.atomicModifyIORef nextPort $ \p -> (p + 1, p)     esocket <- try $ bindPort port HostIPv4     case esocket of-        Left (_ :: IOException) -> getPort+        Left (_ :: IOException) -> RunSpec.getPort         Right socket -> do             sClose socket             return port  withApp :: Settings -> Application -> (Int -> IO a) -> IO a withApp settings app f = do-    port <- getPort+    port <- RunSpec.getPort     baton <- newEmptyMVar     let settings' = setPort port                   $ setBeforeMainLoop (putMVar baton ())
warp.cabal view
@@ -1,5 +1,5 @@ Name:                warp-Version:             2.1.0+Version:             2.1.1 Synopsis:            A fast, light-weight web server for WAI applications. License:             MIT License-file:        LICENSE