diff mercurial/httppeer.py @ 37556:b77aa48ba690

httppeer: only advertise partial-pull if capabilities are known We don't need to be advertising client protocol parameters as part of the capabilities request during the handshake because nothing in version 1 of the wire protocol will use this data. i.e. the advertisement is wasteful. Differential Revision: https://phab.mercurial-scm.org/D3241
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 10 Apr 2018 18:13:28 -0700
parents 930c433eb311
children 8a73132214a3
line wrap: on
line diff
--- a/mercurial/httppeer.py	Tue Apr 10 16:53:44 2018 -0700
+++ b/mercurial/httppeer.py	Tue Apr 10 18:13:28 2018 -0700
@@ -210,7 +210,9 @@
     # Tell the server we accept application/mercurial-0.2 and multiple
     # compression formats if the server is capable of emitting those
     # payloads.
-    protoparams = {'partial-pull'}
+    # Note: Keep this set empty by default, as client advertisement of
+    # protocol parameters should only occur after the handshake.
+    protoparams = set()
 
     mediatypes = set()
     if caps is not None:
@@ -219,6 +221,8 @@
             protoparams.add('0.1')
             mediatypes = set(mt.split(','))
 
+        protoparams.add('partial-pull')
+
     if '0.2tx' in mediatypes:
         protoparams.add('0.2')