negotiate P2P protocol version for tor remotes

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 c81768d425 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 31e1adc005.

Sponsored-by: Brett Eisenberg on Patreon.
This commit is contained in:
Joey Hess 2021-10-11 15:53:49 -04:00
parent f8816d2b92
commit 17a0fa3dbc
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 7 additions and 9 deletions

View 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