Mercurial > public > mercurial-scm > hg
diff mercurial/wireprotoserver.py @ 37129:aaabd709df72
wireproto: review fixups
Capture various TODOs and return an explicit value. This
represents feedback from Yuya and Augie on various commits.
Differential Revision: https://phab.mercurial-scm.org/D2944
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 26 Mar 2018 09:21:07 -0700 |
parents | a8a902d7176e |
children | 3ed344546d9e |
line wrap: on
line diff
--- a/mercurial/wireprotoserver.py Mon Mar 26 10:22:13 2018 -0700 +++ b/mercurial/wireprotoserver.py Mon Mar 26 09:21:07 2018 -0700 @@ -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)