From 4ff7f4b48f372e1cbea63873c5604ee3b4b56d09 Mon Sep 17 00:00:00 2001 From: pho Date: Tue, 6 Nov 2007 12:25:33 +0900 Subject: [PATCH] Fixed two bugs darcs-hash:20071106032533-62b54-ce2337eafd0204c00af6faac505f1e1bb31f2d42.gz --- ImplantFile.hs | 2 +- Lucu.cabal | 9 +++++++++ Network/HTTP/Lucu/StaticFile.hs | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) 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 を推定 -- 2.40.0