Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/sshserver.py @ 11623:31d0a6d50ee2
protocol: extract compression from streaming mechanics
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Fri, 16 Jul 2010 22:20:10 +0200 |
parents | 1d48681b17a4 |
children | cdeb861335d5 |
comparison
equal
deleted
inserted
replaced
11622:1d48681b17a4 | 11623:31d0a6d50ee2 |
---|---|
57 count = int(self.fin.readline()) | 57 count = int(self.fin.readline()) |
58 | 58 |
59 def redirect(self): | 59 def redirect(self): |
60 pass | 60 pass |
61 | 61 |
62 def sendresponse(self, v): | 62 def groupchunks(self, changegroup): |
63 self.fout.write("%d\n" % len(v)) | |
64 self.fout.write(v) | |
65 self.fout.flush() | |
66 | |
67 def sendchangegroup(self, changegroup): | |
68 while True: | 63 while True: |
69 d = changegroup.read(4096) | 64 d = changegroup.read(4096) |
70 if not d: | 65 if not d: |
71 break | 66 break |
72 self.fout.write(d) | 67 yield d |
73 | 68 |
69 def sendresponse(self, v): | |
70 self.fout.write("%d\n" % len(v)) | |
71 self.fout.write(v) | |
74 self.fout.flush() | 72 self.fout.flush() |
75 | 73 |
76 def sendstream(self, source): | 74 def sendstream(self, source): |
77 for chunk in source: | 75 for chunk in source: |
78 self.fout.write(chunk) | 76 self.fout.write(chunk) |