Patchwork D3387: wireprotov2: remove support for sending bytes response

login
register
mail settings
Submitter phabricator
Date April 15, 2018, 12:22 a.m.
Message ID <differential-rev-PHID-DREV-n7rmzwax4zrlsycn3tkj-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/31067/
State Superseded
Headers show

Comments

phabricator - April 15, 2018, 12:22 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We recently declared that all responses must be CBOR. So remove
  support for sending a type that isn't CBOR data.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/wireprotov2server.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py
--- a/mercurial/wireprotov2server.py
+++ b/mercurial/wireprotov2server.py
@@ -301,11 +301,7 @@ 
     res.status = b'200 OK'
     res.headers[b'Content-Type'] = FRAMINGTYPE
 
-    if isinstance(rsp, wireprototypes.bytesresponse):
-        action, meta = reactor.oncommandresponseready(outstream,
-                                                     command['requestid'],
-                                                     rsp.data)
-    elif isinstance(rsp, wireprototypes.cborresponse):
+    if isinstance(rsp, wireprototypes.cborresponse):
         encoded = cbor.dumps(rsp.value, canonical=True)
         action, meta = reactor.oncommandresponseready(outstream,
                                                       command['requestid'],