packages feed

mighttpd2 2.4.1 → 2.4.2

raw patch · 4 files changed

+15/−5 lines, 4 files

Files

FileCache.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE BangPatterns #-}+ module FileCache (fileCacheInit) where  import Control.Concurrent@@ -14,10 +16,14 @@  data Entry = Negative | Positive FileInfo type Cache = Map ByteString Entry-type GetInfo = Path -> IO (Maybe FileInfo)+type GetInfo = Path -> IO FileInfo  fileInfo :: IORef Cache -> GetInfo-fileInfo ref path = atomicModifyIORef ref (lok path)+fileInfo ref path = do+  !mx <- atomicModifyIORef ref (lok path)+  case mx of+      Nothing -> throwIO (userError "fileInfo")+      Just x  -> return x  lok :: Path -> Cache -> (Cache, Maybe FileInfo) lok path cache = unsafePerformIO $ do
Parser.hs view
@@ -1,6 +1,7 @@ module Parser where  import Control.Applicative hiding (many,(<|>))+import Control.Exception import qualified Data.ByteString.Lazy.Char8 as BL import System.IO import Text.Parsec@@ -33,4 +34,4 @@     bs <- BL.hGetContents hdl     case parse p "parseFile" bs of         Right x -> return x-        Left  e -> error . show $ e+        Left  e -> throwIO . userError . show $ e
Types.hs view
@@ -4,6 +4,8 @@  import Data.ByteString import Data.ByteString.Char8 ()+import Data.Version+import Paths_mighttpd2  type Src      = ByteString type Dst      = ByteString@@ -21,7 +23,7 @@ programName = "Mighttpd"  programVersion :: String-programVersion = "2.4.0"+programVersion = showVersion version  defaultDomain :: Domain defaultDomain = "localhost"
mighttpd2.cabal view
@@ -1,5 +1,5 @@ Name:                   mighttpd2-Version:                2.4.1+Version:                2.4.2 Author:                 Kazu Yamamoto <kazu@iij.ad.jp> Maintainer:             Kazu Yamamoto <kazu@iij.ad.jp> License:                BSD3@@ -31,6 +31,7 @@                         Parser                         Route                         Types+                        Paths_mighttpd2 Executable mkindex   Main-Is:              mkindex.hs   GHC-Options:          -Wall -fno-warn-unused-do-bind