Skip to content

Commit

Permalink
no maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Sep 4, 2023
1 parent 6328750 commit f243e31
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions Network/HTTP2/Arch/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ data Config = Config {
, confPositionReadMaker :: PositionReadMaker
, confTimeoutManager :: T.Manager
-- | This is copied into 'Aux', if exist, on server.
, confMySockAddr :: Maybe SockAddr
, confMySockAddr :: SockAddr
-- | This is copied into 'Aux', if exist, on server.
, confPeerSockAddr :: Maybe SockAddr
, confPeerSockAddr :: SockAddr
}

-- | Making simple configuration whose IO is not efficient.
Expand All @@ -47,8 +47,8 @@ allocSimpleConfig s bufsiz = do
, confReadN = defaultReadN s ref
, confPositionReadMaker = defaultPositionReadMaker
, confTimeoutManager = timmgr
, confMySockAddr = Just mysa
, confPeerSockAddr = Just peersa
, confMySockAddr = mysa
, confPeerSockAddr = peersa
}
return config

Expand Down
6 changes: 3 additions & 3 deletions Network/HTTP2/Arch/Context.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ data Context = Context {
, pingRate :: Rate
, settingsRate :: Rate
, emptyFrameRate :: Rate
, mySockAddr :: Maybe SockAddr
, peerSockAddr :: Maybe SockAddr
, mySockAddr :: SockAddr
, peerSockAddr :: SockAddr
}

----------------------------------------------------------------

newContext :: RoleInfo -> BufferSize -> Maybe SockAddr -> Maybe SockAddr -> IO Context
newContext :: RoleInfo -> BufferSize -> SockAddr -> SockAddr -> IO Context
newContext rinfo siz mysa peersa =
Context rl rinfo
<$> newIORef False
Expand Down
4 changes: 2 additions & 2 deletions Network/HTTP2/Server/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ data Aux = Aux {
-- | Time handle for the worker processing this request and response.
auxTimeHandle :: T.Handle
-- | Local socket address copied from 'Config'.
, auxMySockAddr :: Maybe SockAddr
, auxMySockAddr :: SockAddr
-- | Remove socket address copied from 'Config'.
, auxPeerSockAddr :: Maybe SockAddr
, auxPeerSockAddr :: SockAddr
}
4 changes: 2 additions & 2 deletions Network/HTTP2/Server/Worker.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ data WorkerConf a = WorkerConf {
, isPushable :: IO Bool
, insertStream :: StreamId -> a -> IO ()
, makePushStream :: a -> PushPromise -> IO (StreamId, StreamId, a)
, mySockAddr :: Maybe SockAddr
, peerSockAddr :: Maybe SockAddr
, mySockAddr :: SockAddr
, peerSockAddr :: SockAddr
}

fromContext :: Context -> WorkerConf Stream
Expand Down

0 comments on commit f243e31

Please sign in to comment.