equal
deleted
inserted
replaced
24 wireproto, |
24 wireproto, |
25 wireprotoframing, |
25 wireprotoframing, |
26 wireprototypes, |
26 wireprototypes, |
27 ) |
27 ) |
28 |
28 |
29 FRAMINGTYPE = b'application/mercurial-exp-framing-0003' |
29 FRAMINGTYPE = b'application/mercurial-exp-framing-0004' |
30 |
30 |
31 HTTP_WIREPROTO_V2 = wireprototypes.HTTP_WIREPROTO_V2 |
31 HTTP_WIREPROTO_V2 = wireprototypes.HTTP_WIREPROTO_V2 |
32 |
32 |
33 def handlehttpv2request(rctx, req, res, checkperm, urlparts): |
33 def handlehttpv2request(rctx, req, res, checkperm, urlparts): |
34 from .hgweb import common as hgwebcommon |
34 from .hgweb import common as hgwebcommon |
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.onbytesresponseready(outstream, |
311 command['requestid'], |
311 command['requestid'], |
312 encoded, |
312 encoded) |
313 iscbor=True) |
|
314 else: |
313 else: |
315 action, meta = reactor.onapplicationerror( |
314 action, meta = reactor.onapplicationerror( |
316 _('unhandled response type from wire proto command')) |
315 _('unhandled response type from wire proto command')) |
317 |
316 |
318 if action == 'sendframes': |
317 if action == 'sendframes': |