From: pho Date: Tue, 6 Nov 2007 03:25:33 +0000 (+0900) Subject: Fixed two bugs X-Git-Tag: RELEASE-0_2_1~15 X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=4ff7f4b48f372e1cbea63873c5604ee3b4b56d09;p=Lucu.git Fixed two bugs darcs-hash:20071106032533-62b54-ce2337eafd0204c00af6faac505f1e1bb31f2d42.gz --- diff --git a/ImplantFile.hs b/ImplantFile.hs index 26be80e..22fafea 100644 --- a/ImplantFile.hs +++ b/ImplantFile.hs @@ -393,7 +393,7 @@ getMIMEType opts srcFile getLastModified :: FilePath -> IO UTCTime getLastModified "-" = getCurrentTime getLastModified fpath = getFileStatus fpath - >>= return . posixSecondsToUTCTime . toEnum . fromEnum . modificationTime + >>= return . posixSecondsToUTCTime . fromRational . toRational . modificationTime getETag :: [CmdOpt] -> Lazy.ByteString -> IO String diff --git a/Lucu.cabal b/Lucu.cabal index d527a40..e545e99 100644 --- a/Lucu.cabal +++ b/Lucu.cabal @@ -24,6 +24,10 @@ Extra-Source-Files: examples/HelloWorld.hs examples/Makefile +Flag build-lucu-implant-file + Description: Build the lucu-implant-file program. + Default: True + Library Build-Depends: Crypto, base, bytestring, containers, directory, haskell-src, @@ -66,9 +70,14 @@ Library -funbox-strict-fields Executable lucu-implant-file + if flag(build-lucu-implant-file) + Buildable: True + else + Buildable: False Main-Is: ImplantFile.hs ghc-options: -Wall + -XUnboxedTuples -funbox-strict-fields --Executable HelloWorld diff --git a/Network/HTTP/Lucu/StaticFile.hs b/Network/HTTP/Lucu/StaticFile.hs index 7c2ce5c..608d608 100644 --- a/Network/HTTP/Lucu/StaticFile.hs +++ b/Network/HTTP/Lucu/StaticFile.hs @@ -64,7 +64,7 @@ handleStaticFile path $ abort Forbidden [] Nothing -- 讀める tag <- liftIO $ generateETagFromFile path - lastMod <- return $ posixSecondsToUTCTime $ toEnum $ fromEnum $ modificationTime stat + lastMod <- return $ posixSecondsToUTCTime $ fromRational $ toRational $ modificationTime stat foundEntity tag lastMod -- MIME Type を推定