module Network.HTTP2.TLS.Settings where

-- Settings type.
data Settings = Settings
    { Settings -> Int
settingsTimeout :: Int
    -- ^ Timeout in seconds. (All)
    , Settings -> Int
settingsSendBufferSize :: Int
    -- ^ Send buffer size. (H2 and H2c)
    , Settings -> Int
settingsSlowlorisSize :: Int
    -- ^ If the size of receiving data is less than or equal,
    --   the timeout is not reset.
    --   (All)
    , Settings -> Int
settingReadBufferSize :: Int
    -- ^ When the size of a read buffer is lower than this limit, the buffer is thrown awany (and is eventually freed). Then a new buffer is allocated. (All)
    , Settings -> Int
settingReadBufferLowerLimit :: Int
    -- ^  The allocation size for a read buffer.  (All)
    } deriving (Settings -> Settings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Settings -> Settings -> Bool
$c/= :: Settings -> Settings -> Bool
== :: Settings -> Settings -> Bool
$c== :: Settings -> Settings -> Bool
Eq, Int -> Settings -> ShowS
[Settings] -> ShowS
Settings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Settings] -> ShowS
$cshowList :: [Settings] -> ShowS
show :: Settings -> String
$cshow :: Settings -> String
showsPrec :: Int -> Settings -> ShowS
$cshowsPrec :: Int -> Settings -> ShowS
Show)

-- | Default settings.
--
-- >>> defaultSettings
-- Settings {settingsTimeout = 30, settingsSendBufferSize = 4096, settingsSlowlorisSize = 50, settingReadBufferSize = 16384, settingReadBufferLowerLimit = 2048}
defaultSettings :: Settings
defaultSettings :: Settings
defaultSettings =
    Settings
        { settingsTimeout :: Int
settingsTimeout = Int
30
        , settingsSendBufferSize :: Int
settingsSendBufferSize = Int
4096
        , settingsSlowlorisSize :: Int
settingsSlowlorisSize = Int
50
        , settingReadBufferSize :: Int
settingReadBufferSize = Int
16384
        , settingReadBufferLowerLimit :: Int
settingReadBufferLowerLimit = Int
2048
        }