implement clientLockContent
This commit is contained in:
parent
f5dd7a8bc0
commit
63e42aa1bc
1 changed files with 14 additions and 8 deletions
14
P2P/Http.hs
14
P2P/Http.hs
|
@ -841,20 +841,26 @@ serveLockContent st su apiver (B64Key k) cu bypass sec auth = do
|
||||||
Nothing -> return $ LockResult False Nothing
|
Nothing -> return $ LockResult False Nothing
|
||||||
|
|
||||||
clientLockContent
|
clientLockContent
|
||||||
:: B64UUID ServerSide
|
:: ClientEnv
|
||||||
|
-> B64UUID ServerSide
|
||||||
-> ProtocolVersion
|
-> ProtocolVersion
|
||||||
-> B64Key
|
-> B64Key
|
||||||
-> B64UUID ClientSide
|
-> B64UUID ClientSide
|
||||||
-> [B64UUID Bypass]
|
-> [B64UUID Bypass]
|
||||||
-> Maybe Auth
|
-> Maybe Auth
|
||||||
-> ClientM LockResult
|
-> IO LockResult
|
||||||
clientLockContent su (ProtocolVersion ver) = case ver of
|
clientLockContent clientenv su (ProtocolVersion ver) k cu bypass auth =
|
||||||
|
withClientM (cli k cu bypass auth) clientenv $ \case
|
||||||
|
Left err -> throwM err
|
||||||
|
Right res -> return res
|
||||||
|
where
|
||||||
|
cli = case ver of
|
||||||
3 -> v3 su V3
|
3 -> v3 su V3
|
||||||
2 -> v2 su V2
|
2 -> v2 su V2
|
||||||
1 -> v1 su V1
|
1 -> v1 su V1
|
||||||
0 -> v0 su V0
|
0 -> v0 su V0
|
||||||
_ -> error "unsupported protocol version"
|
_ -> error "unsupported protocol version"
|
||||||
where
|
|
||||||
_ :<|> _ :<|> _ :<|> _ :<|>
|
_ :<|> _ :<|> _ :<|> _ :<|>
|
||||||
_ :<|> _ :<|> _ :<|> _ :<|>
|
_ :<|> _ :<|> _ :<|> _ :<|>
|
||||||
_ :<|> _ :<|> _ :<|> _ :<|>
|
_ :<|> _ :<|> _ :<|> _ :<|>
|
||||||
|
|
Loading…
Add table
Reference in a new issue