diff mercurial/wireprotoserver.py @ 37285:3ed344546d9e

wireproto: start to associate frame generation with a stream An upcoming commit will introduce "streams" into the frame-based wire protocol. In preparation for this invasive change, we introduce a basic "stream" class and have all operations that create frames also operate alongside a stream instance. Differential Revision: https://phab.mercurial-scm.org/D2906
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 26 Mar 2018 13:57:22 -0700
parents aaabd709df72
children 9bfcbe4f4745
line wrap: on
line diff
--- a/mercurial/wireprotoserver.py	Mon Mar 26 13:51:22 2018 -0700
+++ b/mercurial/wireprotoserver.py	Mon Mar 26 13:57:22 2018 -0700
@@ -546,9 +546,11 @@
 
     res.status = b'200 OK'
     res.headers[b'Content-Type'] = FRAMINGTYPE
+    stream = wireprotoframing.stream()
 
     if isinstance(rsp, wireprototypes.bytesresponse):
-        action, meta = reactor.onbytesresponseready(command['requestid'],
+        action, meta = reactor.onbytesresponseready(stream,
+                                                    command['requestid'],
                                                     rsp.data)
     else:
         action, meta = reactor.onapplicationerror(