make keeplocked client UUID optional
authorJoey Hess <joeyh@joeyh.name>
Mon, 22 Jul 2024 23:48:54 +0000 (19:48 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 22 Jul 2024 23:48:54 +0000 (19:48 -0400)
It's not used, but it makes the protocol simpler if this parameter can
always be sent.

P2P/Http.hs

index 638a81ed53edd7cdef89a86afd6739df820d91c4..9919822f0a12284eaeab29ce2a1f3adccbeeed02 100644 (file)
@@ -872,7 +872,7 @@ clientLockContent clientenv (ProtocolVersion ver) k su cu bypass auth =
 
 type KeepLockedAPI
        = LockIDParam
-       :> CU Required
+       :> CU Optional
        :> BypassUUIDs
        :> IsSecure
        :> AuthHeader
@@ -887,7 +887,7 @@ serveKeepLocked
        -> B64UUID ServerSide
        -> v
        -> LockID
-       -> B64UUID ClientSide
+       -> Maybe (B64UUID ClientSide)
        -> [B64UUID Bypass]
        -> IsSecure
        -> Maybe Auth
@@ -923,7 +923,7 @@ clientKeepLocked
 clientKeepLocked clientenv (ProtocolVersion ver) lckid su cu bypass auth a = do
        keeplocked <- newEmptyTMVarIO
        tid <- async $ a keeplocked
-       let cli' = cli lckid cu bypass auth
+       let cli' = cli lckid (Just cu) bypass auth
                (Just connectionKeepAlive) (Just keepAlive)
                (S.fromStepT (unlocksender keeplocked))
        withClientM cli' clientenv $ \case