diff mercurial/wireprotov2peer.py @ 37722:89a16704114c

wireprotov2: define response data as CBOR Previously, response data was defined as a stream of bytes. We had the option to declare it as CBOR using a frame flag. We've converged all wire protocol commands exposed on version 2 to CBOR. I think consistency is important. The overhead to encoding things with CBOR is minimal. Even a very large bytestring can be efficiently encoded using an indefinite length bytestring. Now, there are limitations with consumers not being able to efficiently stream large CBOR values. But these feel like solvable problems. This commit removes the "is CBOR" frame flag from command response frames and defines the frame as always consisting of a stream of CBOR values. The framing protocol media type has been bumped to reflect this BC change. Differential Revision: https://phab.mercurial-scm.org/D3382
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 14 Apr 2018 12:07:31 -0700
parents f7673845b167
children 3ea8323d6f95
line wrap: on
line diff
--- a/mercurial/wireprotov2peer.py	Sat Apr 14 11:49:06 2018 -0700
+++ b/mercurial/wireprotov2peer.py	Sat Apr 14 12:07:31 2018 -0700
@@ -25,7 +25,6 @@
         self.requestid = requestid
         self.command = command
 
-        self.cbor = False
         self.b = util.bytesio()
 
     def cborobjects(self):
@@ -124,9 +123,6 @@
         if action == 'responsedata':
             response.b.write(meta['data'])
 
-            if meta['cbor']:
-                response.cbor = True
-
             if meta['eos']:
                 # If the command has a decoder, resolve the future to the
                 # decoded value. Otherwise resolve to the rich response object.