1 module Network.HTTP.Lucu.Config
3 , defaultConfig -- Config
7 import qualified Data.Map as M
11 import Network.HTTP.Lucu.MIMEType
12 import Network.HTTP.Lucu.MIMEType.DefaultExtensionMap
13 import System.IO.Unsafe
16 data Config = Config {
17 cnfServerSoftware :: String
18 , cnfServerHost :: HostName
19 , cnfServerPort :: PortID
20 , cnfMaxPipelineDepth :: Int
21 , cnfMaxEntityLength :: Int
22 , cnfMaxURILength :: Int
23 , cnfMaxOutputChunkLength :: Int
24 , cnfExtToMIMEType :: Map String MIMEType
28 defaultConfig = Config {
29 cnfServerSoftware = "Lucu/1.0"
30 , cnfServerHost = unsafePerformIO getHostName
31 , cnfServerPort = Service "http"
32 , cnfMaxPipelineDepth = 100
33 , cnfMaxEntityLength = 16 * 1024 * 1024 -- 16 MiB
34 , cnfMaxURILength = 4 * 1024 -- 4 KiB
35 , cnfMaxOutputChunkLength = 5 * 1024 * 1024 -- 5 MiB
36 , cnfExtToMIMEType = defaultExtensionMap