Patchwork D2986: wireproto: add frame flag to denote payloads as CBOR

login
register
mail settings
Submitter phabricator
Date April 3, 2018, 4:52 p.m.
Message ID <9faccc7d0e41d25c83b22556f0611616@localhost.localdomain>
Download mbox | patch
Permalink /patch/30193/
State Not Applicable
Headers show

Comments

phabricator - April 3, 2018, 4:52 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe9aadee698cf: wireproto: add frame flag to denote payloads as CBOR (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2986?vs=7449&id=7560

REVISION DETAIL
  https://phab.mercurial-scm.org/D2986

AFFECTED FILES
  mercurial/help/internals/wireprotocol.txt
  mercurial/wireprotoframing.py

CHANGE DETAILS




To: indygreg, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/mercurial/wireprotoframing.py b/mercurial/wireprotoframing.py
--- a/mercurial/wireprotoframing.py
+++ b/mercurial/wireprotoframing.py
@@ -79,10 +79,12 @@ 
 
 FLAG_BYTES_RESPONSE_CONTINUATION = 0x01
 FLAG_BYTES_RESPONSE_EOS = 0x02
+FLAG_BYTES_RESPONSE_CBOR = 0x04
 
 FLAGS_BYTES_RESPONSE = {
     b'continuation': FLAG_BYTES_RESPONSE_CONTINUATION,
     b'eos': FLAG_BYTES_RESPONSE_EOS,
+    b'cbor': FLAG_BYTES_RESPONSE_CBOR,
 }
 
 FLAG_ERROR_RESPONSE_PROTOCOL = 0x01
diff --git a/mercurial/help/internals/wireprotocol.txt b/mercurial/help/internals/wireprotocol.txt
--- a/mercurial/help/internals/wireprotocol.txt
+++ b/mercurial/help/internals/wireprotocol.txt
@@ -631,19 +631,21 @@ 
    server. The command has been fully issued and no new data for this
    command will be sent. The next frame will belong to a new command.
 
-Bytes Response Data (``0x04``)
-------------------------------
+Response Data (``0x04``)
+------------------------
 
-This frame contains raw bytes response data to an issued command.
+This frame contains raw response data to an issued command.
 
 The following flag values are defined for this type:
 
 0x01
-   Data continuation. When set, an additional frame containing raw
-   response data will follow.
+   Data continuation. When set, an additional frame containing response data
+   will follow.
 0x02
-   End of data. When sent, the response data has been fully sent and
+   End of data. When set, the response data has been fully sent and
    no additional frames for this response will be sent.
+0x04
+   CBOR data. When set, the frame payload consists of CBOR data.
 
 The ``0x01`` flag is mutually exclusive with the ``0x02`` flag.