mighttpd2 3.2.4 → 3.2.5
raw patch · 4 files changed
+39/−33 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- mighttpd2.cabal +2/−2
- src/Mighty.hs +2/−2
- src/Server.hs +4/−4
- utils/mkindex.hs +31/−25
mighttpd2.cabal view
@@ -1,5 +1,5 @@ Name: mighttpd2-Version: 3.2.4+Version: 3.2.5 Author: Kazu Yamamoto <kazu@iij.ad.jp> Maintainer: Kazu Yamamoto <kazu@iij.ad.jp> License: BSD3@@ -66,7 +66,7 @@ Main-Is: Mighty.hs GHC-Options: -Wall -threaded -rtsopts if flag(tls)- Cpp-Options: -DTLS+ Cpp-Options: -DHTTP_OVER_TLS Build-Depends: async Build-Depends: base >= 4.0 && < 5 , bytestring
src/Mighty.hs view
@@ -2,7 +2,7 @@ module Main where -#ifndef TLS+#ifndef HTTP_OVER_TLS import Control.Monad (when) #endif import Data.Version (showVersion)@@ -72,7 +72,7 @@ hPutStrLn stderr $ reportFile ++ " is not writable" hPrint stderr e exitFailure-#ifdef TLS+#ifdef HTTP_OVER_TLS checkTLS _ = return () #else checkTLS opt = when (opt_service opt > 1) $ do
src/Server.hs view
@@ -21,10 +21,10 @@ import Program.Mighty import WaiApp -#ifdef TLS+#ifdef HTTP_OVER_TLS import Control.Concurrent.Async (concurrently)-import Network.Wai.Handler.WarpTLS import Control.Monad (void)+import Network.Wai.Handler.WarpTLS #else data TLSSettings = TLSSettings #endif@@ -58,7 +58,7 @@ svc <- openService opt unless debug writePidFile rdr <- newRouteDBRef route-#ifdef TLS+#ifdef HTTP_OVER_TLS cert <- BS.readFile $ opt_tls_cert_file opt key <- BS.readFile $ opt_tls_key_file opt let tlsSetting = tlsSettingsMemory cert key@@ -142,7 +142,7 @@ mighty opt rpt svc lgr getInfo mgr rdr _tlsSetting = reportDo rpt $ case svc of HttpOnly s -> runSettingsSocket setting s app-#ifdef TLS+#ifdef HTTP_OVER_TLS HttpsOnly s -> runTLSSocket _tlsSetting setting s app HttpAndHttps s1 s2 -> void $ concurrently (runSettingsSocket setting s1 app)
utils/mkindex.hs view
@@ -1,15 +1,21 @@-{-- mkindex :: Making index.html for the current directory.--}+{-# LANGUAGE CPP #-}++-- mkindex :: Making index.html for the current directory.+ import Control.Applicative import Data.Bits-import Data.Time+import Data.Time (formatTime) import Data.Time.Clock.POSIX import System.Directory-import System.Locale import System.Posix.Files import Text.Printf +#if MIN_VERSION_time(1,5,0)+import Data.Time (defaultTimeLocale)+#else+import System.Locale (defaultTimeLocale)+#endif+ indexFile :: String indexFile = "index.html" @@ -67,29 +73,29 @@ header :: String header = "\-\<html>\n\-\<head>\n\-\<style type=\"text/css\">\n\-\<!--\n\-\body { padding-left: 10%; }\n\-\h1 { font-size: x-large; }\n\-\pre { font-size: large; }\n\-\hr { text-align: left; margin-left: 0px; width: 80% }\n\-\-->\n\-\</style>\n\-\</head>\n\-\<title>Directory contents</title>\n\-\<body>\n\-\<h1>Directory contents</h1>\n\-\<hr>\n\-\<pre>\n"+<html>\n\+<head>\n\+<style type=\"text/css\">\n\+<!--\n\+body { padding-left: 10%; }\n\+h1 { font-size: x-large; }\n\+pre { font-size: large; }\n\+hr { text-align: left; margin-left: 0px; width: 80% }\n\+-->\n\+</style>\n\+</head>\n\+<title>Directory contents</title>\n\+<body>\n\+<h1>Directory contents</h1>\n\+<hr>\n\+<pre>\n" content :: Int -> (String,String,String,Int) -> String content lim (f,m,s,len) = "<a href=\"" ++ f ++ "\">" ++ f ++ "</a> " ++ replicate (lim - len) ' ' ++ m ++ " " ++ s ++ "\n" tailer :: String tailer = "\-\</pre>\n\-\<hr>\n\-\</body>\n\-\</html>\n"+</pre>\n\+<hr>\n\+</body>\n\+</html>\n"