##// END OF EJS Templates
wireproto: rename argument to groupchunks()...
Gregory Szorc -
r30014:d34cf260 default
parent child Browse files
Show More
@@ -73,13 +73,13 b' class webproto(wireproto.abstractserverp'
73 73 val = self.ui.fout.getvalue()
74 74 self.ui.ferr, self.ui.fout = self.oldio
75 75 return val
76 def groupchunks(self, cg):
76 def groupchunks(self, fh):
77 77 # Don't allow untrusted settings because disabling compression or
78 78 # setting a very high compression level could lead to flooding
79 79 # the server's network or CPU.
80 80 z = zlib.compressobj(self.ui.configint('server', 'zliblevel', -1))
81 81 while True:
82 chunk = cg.read(32768)
82 chunk = fh.read(32768)
83 83 if not chunk:
84 84 break
85 85 data = z.compress(chunk)
@@ -68,8 +68,8 b' class sshserver(wireproto.abstractserver'
68 68 def redirect(self):
69 69 pass
70 70
71 def groupchunks(self, changegroup):
72 return iter(lambda: changegroup.read(4096), '')
71 def groupchunks(self, fh):
72 return iter(lambda: fh.read(4096), '')
73 73
74 74 def sendresponse(self, v):
75 75 self.fout.write("%d\n" % len(v))
@@ -78,10 +78,11 b' class abstractserverproto(object):'
78 78 # """
79 79 # raise NotImplementedError()
80 80
81 def groupchunks(self, cg):
82 """return 4096 chunks from a changegroup object
81 def groupchunks(self, fh):
82 """Generator of chunks to send to the client.
83 83
84 Some protocols may have compressed the contents."""
84 Some protocols may have compressed the contents.
85 """
85 86 raise NotImplementedError()
86 87
87 88 class remotebatch(peer.batcher):
General Comments 0
You need to be logged in to leave comments. Login now