From 96853cd8332a43e70aac138ef89882d6c44395c0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 12 Jun 2024 10:40:51 -0400 Subject: [PATCH] finish P2P protocol proxying CONNECT is not supported by git-annex-shell p2pstdio, but for proxying to tor-annex remotes, it will be supported, and will make a git pull/push to a proxied remote work the same with that as it does over ssh, eg it accesses the proxy's git repo not the proxied remote's git repo. The p2p protocol docs say that NOTIFYCHANGES is not always supported, and it looked annoying to implement it for this, and it also seems pretty useless, so make it be a protocol error. git-annex remotedaemon will already be getting change notifications from the proxy's git repo, so there's no need to get additional redundant change notifications for proxied remotes that would be for changes to the same git repo. --- P2P/Proxy.hs | 7 +++++-- doc/design/p2p_protocol.mdwn | 2 ++ doc/todo/git-annex_proxies.mdwn | 4 +--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/P2P/Proxy.hs b/P2P/Proxy.hs index 1fe300f8fa..9063702cbd 100644 --- a/P2P/Proxy.hs +++ b/P2P/Proxy.hs @@ -119,8 +119,11 @@ proxy proxydone servermode clientside remoteside othermessage protoerrhandler = -- not the remote. CONNECT service -> servermodechecker (checkCONNECTServerMode service) $ - giveup "TODO CONNECT" - NOTIFYCHANGE -> giveup "TODO NOTIFYCHANGE" + -- P2P protocol does not continue after + -- relaying from git. + protoerrhandler (\() -> proxydone) $ + client $ net $ relayService service + NOTIFYCHANGE -> protoerr -- Messages that the client should only send after one of -- the messages above. SUCCESS -> protoerr diff --git a/doc/design/p2p_protocol.mdwn b/doc/design/p2p_protocol.mdwn index 1ee5f00172..3f9f7cdbc1 100644 --- a/doc/design/p2p_protocol.mdwn +++ b/doc/design/p2p_protocol.mdwn @@ -192,6 +192,8 @@ its exit code. CONNECTDONE ExitCode +After that, the server closes the connection. + ## Change notification The client can request to be notified when a ref in diff --git a/doc/todo/git-annex_proxies.mdwn b/doc/todo/git-annex_proxies.mdwn index f03a784f9a..e084bda311 100644 --- a/doc/todo/git-annex_proxies.mdwn +++ b/doc/todo/git-annex_proxies.mdwn @@ -36,9 +36,7 @@ For June's work on [[design/passthrough_proxy]], implementation plan: 2. Remote instantiation for proxies. (done) -3. Implement git-annex-shell proxying for CONNECT and NOTIFYCHANGES. - (For completeness, they will only be used when using tor-annex - to access a proxy.) +3. Implement git-annex-shell proxying to git remotes. (done) 3. Proxy should update location tracking information for proxied remotes, so it is available to other users who sync with it.