--- a/mercurial/wireprotoserver.py Mon Mar 26 11:00:16 2018 -0700
+++ b/mercurial/wireprotoserver.py Mon Mar 26 13:59:56 2018 -0700
@@ -432,6 +432,8 @@
reactor = wireprotoframing.serverreactor(deferoutput=True)
seencommand = False
+ outstream = reactor.makeoutputstream()
+
while True:
frame = wireprotoframing.readframe(req.bodyfh)
if not frame:
@@ -444,8 +446,8 @@
continue
elif action == 'runcommand':
sentoutput = _httpv2runcommand(ui, repo, req, res, authedperm,
- reqcommand, reactor, meta,
- issubsequent=seencommand)
+ reqcommand, reactor, outstream,
+ meta, issubsequent=seencommand)
if sentoutput:
return
@@ -476,7 +478,7 @@
% action)
def _httpv2runcommand(ui, repo, req, res, authedperm, reqcommand, reactor,
- command, issubsequent):
+ outstream, command, issubsequent):
"""Dispatch a wire protocol command made from HTTPv2 requests.
The authenticated permission (``authedperm``) along with the original
@@ -546,10 +548,9 @@
res.status = b'200 OK'
res.headers[b'Content-Type'] = FRAMINGTYPE
- stream = wireprotoframing.stream(2)
if isinstance(rsp, wireprototypes.bytesresponse):
- action, meta = reactor.onbytesresponseready(stream,
+ action, meta = reactor.onbytesresponseready(outstream,
command['requestid'],
rsp.data)
else: