Skip to content

Commit

Permalink
Merge pull request #99 from edsko/edsko/fourmolu
Browse files Browse the repository at this point in the history
Run fourmolu
  • Loading branch information
kazu-yamamoto committed Nov 10, 2023
2 parents a60abcd + 9ee1f97 commit c21ac82
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 9 deletions.
8 changes: 7 additions & 1 deletion Network/HTTP2/Arch/Context.hs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ data Context = Context
----------------------------------------------------------------

newContext
:: RoleInfo -> Int -> BufferSize -> SockAddr -> SockAddr -> SettingsList -> IO Context
:: RoleInfo
-> Int
-> BufferSize
-> SockAddr
-> SockAddr
-> SettingsList
-> IO Context
newContext rinfo cacheSiz siz mysa peersa settingAlist =
Context rl rinfo settingAlist
<$> newIORef False
Expand Down
4 changes: 2 additions & 2 deletions Network/HTTP2/Arch/Settings.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ pendingMySettings Context{mySettingAlist, myFirstSettings, myPendingAlist} = do
frame1 = settingsFrame id mySettingAlist
-- Initial window update for connection
frames = case lookup SettingsInitialWindowSize mySettingAlist of
Nothing -> []
Just winSiz -> [windowUpdateFrame 0 (winSiz - defaultWindowSize)]
Nothing -> []
Just winSiz -> [windowUpdateFrame 0 (winSiz - defaultWindowSize)]
frames' = frame1 : frames

----------------------------------------------------------------
Expand Down
11 changes: 9 additions & 2 deletions Network/HTTP2/Client/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ data ClientConfig = ClientConfig
-- ^ The maximum number of incoming streams on the net
, windowSize :: WindowSize
-- ^ The window size of incoming streams
} deriving (Eq, Show)
}
deriving (Eq, Show)

-- | The default client config.
--
Expand Down Expand Up @@ -81,7 +82,13 @@ setup ClientConfig{..} conf@Config{..} = do
let clientInfo = newClientInfo scheme authority
myAlist = makeMySettingsList conf concurrentStreams windowSize
ctx <-
newContext clientInfo cacheLimit confBufferSize confMySockAddr confPeerSockAddr myAlist
newContext
clientInfo
cacheLimit
confBufferSize
confMySockAddr
confPeerSockAddr
myAlist
mgr <- start confTimeoutManager
exchangeSettings ctx
return (ctx, mgr)
Expand Down
9 changes: 7 additions & 2 deletions Network/HTTP2/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module Network.HTTP2.Server (
run',

-- * Client configuration
ServerConfig(..),
ServerConfig (..),
defaultServerConfig,

-- * Common configuration
Expand Down Expand Up @@ -112,7 +112,12 @@ import Network.HPACK
import Network.HPACK.Token
import Network.HTTP2.Arch
import Network.HTTP2.Frame.Types
import Network.HTTP2.Server.Run (run, run', ServerConfig(..), defaultServerConfig)
import Network.HTTP2.Server.Run (
ServerConfig (..),
defaultServerConfig,
run,
run',
)
import Network.HTTP2.Server.Types

----------------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions Network/HTTP2/Server/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ data ServerConfig = ServerConfig
-- ^ The maximum number of incoming streams on the net
, windowSize :: WindowSize
-- ^ The window size of incoming streams
} deriving (Eq, Show)
}
deriving (Eq, Show)

-- | The default server config.
--
Expand Down Expand Up @@ -98,7 +99,8 @@ setup :: ServerConfig -> Config -> IO (Context, Manager)
setup ServerConfig{..} conf@Config{..} = do
serverInfo <- newServerInfo
let myAlist = makeMySettingsList conf concurrentStreams windowSize
ctx <- newContext serverInfo 0 confBufferSize confMySockAddr confPeerSockAddr myAlist
ctx <-
newContext serverInfo 0 confBufferSize confMySockAddr confPeerSockAddr myAlist
-- Workers, worker manager and timer manager
mgr <- start confTimeoutManager
return (ctx, mgr)
Expand Down

0 comments on commit c21ac82

Please sign in to comment.