more specific type

This commit is contained in:
Joey Hess 2024-06-17 13:04:40 -04:00
parent b72ccc6f0c
commit 83a1db8d17
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -34,8 +34,8 @@ data ProxyMethods = ProxyMethods
- used to handle a ProtoFailure when receiving a message - used to handle a ProtoFailure when receiving a message
- from the client or remote. - from the client or remote.
-} -}
type ProtoErrorHandled m r = type ProtoErrorHandled r =
(forall t. ((t -> m r) -> m (Either ProtoFailure t) -> m r)) -> m r (forall t. ((t -> Annex r) -> Annex (Either ProtoFailure t) -> Annex r)) -> Annex r
{- This is the first thing run when proxying with a client. {- This is the first thing run when proxying with a client.
- The client has already authenticated. Most clients will send a - The client has already authenticated. Most clients will send a
@ -50,7 +50,7 @@ getClientProtocolVersion
:: Remote :: Remote
-> ClientSide -> ClientSide
-> (Maybe (ProtocolVersion, Maybe Message) -> Annex r) -> (Maybe (ProtocolVersion, Maybe Message) -> Annex r)
-> ProtoErrorHandled Annex r -> ProtoErrorHandled r
getClientProtocolVersion remote (ClientSide client) cont protoerrhandler = getClientProtocolVersion remote (ClientSide client) cont protoerrhandler =
protoerrhandler cont $ client $ getClientProtocolVersion' remote protoerrhandler cont $ client $ getClientProtocolVersion' remote
@ -86,7 +86,7 @@ proxy
-> Maybe Message -> Maybe Message
-- ^ non-VERSION message that was received from the client when -- ^ non-VERSION message that was received from the client when
-- negotiating protocol version, and has not been responded to yet -- negotiating protocol version, and has not been responded to yet
-> ProtoErrorHandled Annex r -> ProtoErrorHandled r
proxy proxydone proxymethods servermode (ClientSide client) (RemoteSide remote remoteuuid) othermessage protoerrhandler = do proxy proxydone proxymethods servermode (ClientSide client) (RemoteSide remote remoteuuid) othermessage protoerrhandler = do
case othermessage of case othermessage of
Just message -> proxyclientmessage (Just message) Just message -> proxyclientmessage (Just message)