Patchwork D2944: wireproto: review fixups

login
register
mail settings
Submitter phabricator
Date March 26, 2018, 5:02 p.m.
Message ID <1e8b24f6ef8f190f0e4f65e40da3f55d@localhost.localdomain>
Download mbox | patch
Permalink /patch/29869/
State Not Applicable
Headers show

Comments

phabricator - March 26, 2018, 5:02 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG86f363eabd90: wireproto: review fixups (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2944?vs=7294&id=7296

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

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

CHANGE DETAILS




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

Patch

diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py
--- a/mercurial/wireprotoserver.py
+++ b/mercurial/wireprotoserver.py
@@ -353,6 +353,7 @@ 
         res.setbodybytes(_('invalid wire protocol command: %s') % command)
         return
 
+    # TODO consider cases where proxies may add additional Accept headers.
     if req.headers.get(b'Accept') != FRAMINGTYPE:
         res.status = b'406 Not Acceptable'
         res.headers[b'Content-Type'] = b'text/plain'
@@ -507,6 +508,7 @@ 
                              command['command'])
             return True
 
+        # TODO don't use assert here, since it may be elided by -O.
         assert authedperm in (b'ro', b'rw')
         wirecommand = wireproto.commands[command['command']]
         assert wirecommand.permission in ('push', 'pull')
@@ -556,7 +558,7 @@ 
         res.setbodygen(meta['framegen'])
         return True
     elif action == 'noop':
-        pass
+        return False
     else:
         raise error.ProgrammingError('unhandled event from reactor: %s' %
                                      action)
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
@@ -711,6 +711,8 @@ 
 * 0 or more UTF-8 strings that will be used as arguments to the
   formatting string.
 
+TODO use ASCII for formatting string.
+
 All data to be printed MUST be encoded into a single frame: this frame
 does not support spanning data across multiple frames.