negotiate P2P protocol version for tor remotes
authorJoey Hess <joeyh@joeyh.name>
Mon, 11 Oct 2021 19:53:49 +0000 (15:53 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 11 Oct 2021 19:58:51 +0000 (15:58 -0400)
This negotiation is not supported by versions of git-annex older
than 6.20180312. Well, maybe really 6.20180227 or so, but using that in
the changelog simplifies things since it was the version for the other
changes as well.

See commit c81768d425725f868ddf23333d49eed0f3fda011 for the back story.

As well as allowing for future protocol improvements, this will result
in negoatiating protocol version 1, which is an improvement over default
version 0.

In fact, it looks like no supported version of git-annex will use
protocol version 0, since version 1 was introduced in 6.20180227.
Still, removing the code for version 0 seems unncessary.
See commit 31e1adc005e8181c5190a9f39a3f148e10f4d364.

Sponsored-by: Brett Eisenberg on Patreon.
CHANGELOG
Remote/P2P.hs
doc/todo/p2p_protocol_flag_days.mdwn

index 0d8ce53f3b5f0075a6b57e4c8fdb162256ac3d5a..c9202beb2a8d74ba0d8f709ed0a8fdd2302e19c1 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,6 +4,9 @@ git-annex (8.20211012) UNRELEASED; urgency=medium
     git-annex older than 6.20180312.
   * git-annex-shell: Removed several commands that were only needed to
     support git-annex versions older than 6.20180312.
+  * Negotiate P2P protocol version with tor remotes, allowing
+    use of protocol version 1. This negotiation is not supported
+    by versions of git-annex older than 6.20180312.
 
  -- Joey Hess <id@joeyh.name>  Mon, 11 Oct 2021 14:09:13 -0400
 
index 2c6056a91cb5a523cd43734e12c77dc3adbfedea..15c2ea1f3e002c0146b55acffdd1c2479ce47d5e 100644 (file)
@@ -148,14 +148,7 @@ openConnection u addr = do
                        authtoken <- fromMaybe nullAuthToken
                                <$> loadP2PRemoteAuthToken addr
                        let proto = P2P.auth myuuid authtoken $
-                               -- Before 6.20180312, the protocol server
-                               -- had a bug that made negotiating the
-                               -- protocol version terminate the
-                               -- connection. So, this must stay disabled
-                               -- until the old version is not in use
-                               -- anywhere.
-                               --P2P.negotiateProtocolVersion P2P.maxProtocolVersion
-                               return ()
+                               P2P.negotiateProtocolVersion P2P.maxProtocolVersion
                        runst <- liftIO $ mkRunState Client
                        res <- liftIO $ runNetProto runst conn proto
                        case res of
index 967295b77ad74df25e2ca48326397ab194c150cf..0b0abcd9eff0cb8cf7190a064eafa24c51466fbb 100644 (file)
@@ -10,6 +10,8 @@ historical bug, the version is not currently negotiated when using the
 protocol over tor. At some point in the future, when all peers can be
 assumed to be upgraded, this should be changed.
 
+> [[done]] --[[Joey]]
+
 ## git-annex-shell fallbacks
 
 When using git-annex-shell p2pio, git-annex assumes that if it exits 1,
@@ -21,6 +23,6 @@ can be assumed to be upgraded to 6.20180312, this fallback can be removed.
 It will allows removing a lot of code from git-annex-shell and a lot of
 fallback code from Remote.Git.
 
-> This part is done now. --[[Joey]]
+> [[done]] --[[Joey]]
 
 [[!tag confirmed]]