support DATA-PRESENT in the p2p protocol proxy
authorJoey Hess <joeyh@joeyh.name>
Tue, 29 Oct 2024 18:20:07 +0000 (14:20 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 29 Oct 2024 18:44:23 +0000 (14:44 -0400)
commit2fc3fbfed28815cdb6a411e2396d38a0672b5dc8
treea01a536a7e143f886787cd18309ff08629a32dc7
parenta4e9057486da1ee652262778299b2a2033258cac
support DATA-PRESENT in the p2p protocol proxy

But not yet when proxying to special remotes.

When proxying for a cluster, the client can store the object on any node
or nodes of the cluster, and send DATA-PRESENT. That gets proxied to each
node, and if any of them agree that they have the data, the proxy will
respond with SUCCESS or SUCCESS-PLUS.

I think it's ok to not check for the proxied remotes supporting protocol
version 4. When there are multiple remotes in a cluster, it behaves as
described above, and if they all respond with ERROR, the result will be
FAILURE. And when not proxying for a cluster, the proxy negotiates the
p2p protocol to be the same version or lower than the proxied remote,
which will prevent sending DATA-PRESENT when it's too old.
P2P/Proxy.hs