]> gitweb @ CieloNegro.org - Lucu.git/blob - Network/HTTP/Lucu/Config.hs
data/mime.types
[Lucu.git] / Network / HTTP / Lucu / Config.hs
1 module Network.HTTP.Lucu.Config
2     ( Config(..)
3     , defaultConfig -- Config
4     )
5     where
6
7 import qualified Data.Map as M
8 import           Data.Map (Map)
9 import           Network
10 import           Network.BSD
11 import           Network.HTTP.Lucu.MIMEType
12 import           System.IO.Unsafe
13
14
15 data Config = Config {
16       cnfServerSoftware   :: String
17     , cnfServerHost       :: HostName
18     , cnfServerPort       :: PortID
19     , cnfMaxPipelineDepth :: Int
20     , cnfMaxEntityLength  :: Int
21     , cnfMaxURILength     :: Int
22     , cnfExtToMIMEType    :: Map String MIMEType
23     }
24
25
26 defaultConfig = Config {
27                   cnfServerSoftware   = "Lucu/1.0"
28                 , cnfServerHost       = unsafePerformIO getHostName
29                 , cnfServerPort       = Service "http"
30                 , cnfMaxPipelineDepth = 100
31                 , cnfMaxEntityLength  = 16 * 1024 * 1024 -- 16 MiB
32                 , cnfMaxURILength     = 4 * 1024         -- 4 KiB
33                 , cnfExtToMIMEType    = undefined -- FIXME
34                 }