use a record to reduce the huge number of parameters
This commit is contained in:
parent
7b56fe1350
commit
6ef6ad808f
3 changed files with 86 additions and 75 deletions
|
@ -61,7 +61,7 @@ performLocal theiruuid servermode = do
|
|||
|
||||
performProxy :: UUID -> P2P.ServerMode -> Remote -> CommandPerform
|
||||
performProxy clientuuid servermode r = do
|
||||
clientside <- proxyClientSide clientuuid
|
||||
clientside <- mkProxyClientSide clientuuid
|
||||
getClientProtocolVersion (Remote.uuid r) clientside
|
||||
(withclientversion clientside)
|
||||
(p2pErrHandler noop)
|
||||
|
@ -77,13 +77,18 @@ performProxy clientuuid servermode r = do
|
|||
p2pDone
|
||||
let errhandler = p2pErrHandler (closeRemoteSide remoteside)
|
||||
proxystate <- liftIO mkProxyState
|
||||
let runproxy othermsg' = proxy closer
|
||||
proxymethods proxystate
|
||||
servermode clientside
|
||||
(Remote.uuid r)
|
||||
(singleProxySelector remoteside)
|
||||
concurrencyconfig
|
||||
protocolversion othermsg' errhandler
|
||||
let proxyparams = ProxyParams
|
||||
{ proxyMethods = proxymethods
|
||||
, proxyState = proxystate
|
||||
, proxyServerMode = servermode
|
||||
, proxyClientSide = clientside
|
||||
, proxyUUID = Remote.uuid r
|
||||
, proxySelector = singleProxySelector remoteside
|
||||
, proxyConcurrencyConfig = concurrencyconfig
|
||||
, proxyProtocolVersion = protocolversion
|
||||
}
|
||||
let runproxy othermsg' = proxy closer proxyparams
|
||||
othermsg' errhandler
|
||||
sendClientProtocolVersion clientside othermsg protocolversion
|
||||
runproxy errhandler
|
||||
withclientversion _ Nothing = p2pDone
|
||||
|
@ -95,11 +100,11 @@ performProxy clientuuid servermode r = do
|
|||
|
||||
performProxyCluster :: UUID -> ClusterUUID -> P2P.ServerMode -> CommandPerform
|
||||
performProxyCluster clientuuid clusteruuid servermode = do
|
||||
clientside <- proxyClientSide clientuuid
|
||||
clientside <- mkProxyClientSide clientuuid
|
||||
proxyCluster clusteruuid p2pDone servermode clientside p2pErrHandler
|
||||
|
||||
proxyClientSide :: UUID -> Annex ClientSide
|
||||
proxyClientSide clientuuid = do
|
||||
mkProxyClientSide :: UUID -> Annex ClientSide
|
||||
mkProxyClientSide clientuuid = do
|
||||
clientrunst <- liftIO (mkRunState $ Serving clientuuid Nothing)
|
||||
ClientSide clientrunst <$> liftIO (stdioP2PConnectionDupped Nothing)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue