packages feed

warp 3.4.7 → 3.4.8

raw patch · 6 files changed

+18/−15 lines, 6 files

Files

ChangeLog.md view
@@ -1,5 +1,10 @@ # ChangeLog for warp +## 3.4.8++* Label the internal hack thread on Windows used to make socket+  listening interruptible.+ ## 3.4.7  * Using time-manager >= 0.2.
Network/Wai/Handler/Warp/FdCache.hs view
@@ -41,7 +41,7 @@ ----------------------------------------------------------------  -- | Creating 'MutableFdCache' and executing the action in the second---   argument. The first argument is a cache duration in second.+--   argument. The first argument is a cache duration in microseconds. withFdCache :: Int -> ((FilePath -> IO (Maybe Fd, Refresh)) -> IO a) -> IO a #ifdef WINDOWS withFdCache _ action = action getFdNothing@@ -109,7 +109,7 @@  ---------------------------------------------------------------- --- The first argument is a cache duration in second.+-- The first argument is a cache duration in microseconds. initialize :: Int -> IO MutableFdCache initialize duration = MutableFdCache <$> mkReaper settings   where
Network/Wai/Handler/Warp/FileInfoCache.hs view
@@ -90,7 +90,7 @@  -- | Creating a file information cache --   and executing the action in the second argument.---   The first argument is a cache duration in second.+--   The first argument is a cache duration in microseconds. withFileInfoCache     :: Int     -> ((FilePath -> IO FileInfo) -> IO a)
Network/Wai/Handler/Warp/Run.hs view
@@ -51,9 +51,6 @@ import Network.Wai.Handler.Warp.SendFile import Network.Wai.Handler.Warp.Settings import Network.Wai.Handler.Warp.Types-#if WINDOWS-import Network.Wai.Handler.Warp.Windows-#endif  -- | Creating 'Connection' for plain HTTP based on a given socket. socketConnection :: Settings -> Socket -> IO Connection@@ -233,19 +230,19 @@ withII set action =     withTimeoutManager $ \tm ->         D.withDateCache $ \dc ->-            F.withFdCache fdCacheDurationInSeconds $ \fdc ->-                I.withFileInfoCache fdFileInfoDurationInSeconds $ \fic -> do+            F.withFdCache fdCacheDurationInMicroseconds $ \fdc ->+                I.withFileInfoCache fdFileInfoDurationInMicroseconds $ \fic -> do                     let ii = InternalInfo tm dc fdc fic                     action ii   where-    !fdCacheDurationInSeconds = settingsFdCacheDuration set * 1000000-    !fdFileInfoDurationInSeconds = settingsFileInfoCacheDuration set * 1000000-    !timeoutInSeconds = settingsTimeout set * 1000000+    !fdCacheDurationInMicroseconds = settingsFdCacheDuration set * 1000000+    !fdFileInfoDurationInMicroseconds = settingsFileInfoCacheDuration set * 1000000+    !timeoutInMicroseconds = settingsTimeout set * 1000000     withTimeoutManager f = case settingsManager set of         Just tm -> f tm         Nothing ->             E.bracket-                (T.initialize timeoutInSeconds)+                (T.initialize timeoutInMicroseconds)                 T.stopManager                 f 
Network/Wai/Handler/Warp/Windows.hs view
@@ -9,7 +9,7 @@ import Control.Concurrent import qualified Control.Exception -import Network.Wai.Handler.Warp.Imports+import GHC.Conc (labelThread)  -- | Allow main socket listening thread to be interrupted on Windows platform --@@ -18,7 +18,8 @@ windowsThreadBlockHack act = do     var <- newEmptyMVar :: IO (MVar (Either Control.Exception.SomeException a))     -- Catch and rethrow even async exceptions, so don't bother with UnliftIO-    void . forkIO $ Control.Exception.try act >>= putMVar var+    threadId <- forkIO $ Control.Exception.try act >>= putMVar var+    labelThread threadId "Windows Thread Block Hack (warp)"     res <- takeMVar var     case res of       Left  e -> Control.Exception.throwIO e
warp.cabal view
@@ -1,6 +1,6 @@ cabal-version:      >=1.10 name:               warp-version:            3.4.7+version:            3.4.8 license:            MIT license-file:       LICENSE maintainer:         michael@snoyman.com