Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/wireprotov2server.py @ 37724:deff7cf7eefd
wireprotov2: change frame type and name for command response
There was hole at frame type value 3. And the frame is better
named as a command response.
Differential Revision: https://phab.mercurial-scm.org/D3384
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 14 Apr 2018 14:37:23 -0700 |
parents | 89a16704114c |
children | 3ea8323d6f95 |
comparison
equal
deleted
inserted
replaced
37723:e8fba6d578f0 | 37724:deff7cf7eefd |
---|---|
300 | 300 |
301 res.status = b'200 OK' | 301 res.status = b'200 OK' |
302 res.headers[b'Content-Type'] = FRAMINGTYPE | 302 res.headers[b'Content-Type'] = FRAMINGTYPE |
303 | 303 |
304 if isinstance(rsp, wireprototypes.bytesresponse): | 304 if isinstance(rsp, wireprototypes.bytesresponse): |
305 action, meta = reactor.onbytesresponseready(outstream, | 305 action, meta = reactor.oncommandresponseready(outstream, |
306 command['requestid'], | 306 command['requestid'], |
307 rsp.data) | 307 rsp.data) |
308 elif isinstance(rsp, wireprototypes.cborresponse): | 308 elif isinstance(rsp, wireprototypes.cborresponse): |
309 encoded = cbor.dumps(rsp.value, canonical=True) | 309 encoded = cbor.dumps(rsp.value, canonical=True) |
310 action, meta = reactor.onbytesresponseready(outstream, | 310 action, meta = reactor.oncommandresponseready(outstream, |
311 command['requestid'], | 311 command['requestid'], |
312 encoded) | 312 encoded) |
313 else: | 313 else: |
314 action, meta = reactor.onapplicationerror( | 314 action, meta = reactor.onapplicationerror( |
315 _('unhandled response type from wire proto command')) | 315 _('unhandled response type from wire proto command')) |
316 | 316 |
317 if action == 'sendframes': | 317 if action == 'sendframes': |