Show More
@@ -123,23 +123,13 b' class httprepository(remoterepository):' | |||
|
123 | 123 | f = self.do_cmd("changegroup", roots=n) |
|
124 | 124 | bytes = 0 |
|
125 | 125 | |
|
126 | class zread: | |
|
127 | def __init__(self, f): | |
|
128 | self.zd = zlib.decompressobj() | |
|
129 | self.f = f | |
|
130 | self.buf = "" | |
|
131 | def read(self, l): | |
|
132 | while l > len(self.buf): | |
|
133 | r = self.f.read(4096) | |
|
134 | if r: | |
|
135 | self.buf += self.zd.decompress(r) | |
|
136 | else: | |
|
137 | self.buf += self.zd.flush() | |
|
138 | break | |
|
139 | d, self.buf = self.buf[:l], self.buf[l:] | |
|
140 | return d | |
|
126 | def zgenerator(f): | |
|
127 | zd = zlib.decompressobj() | |
|
128 | for chnk in f: | |
|
129 | yield zd.decompress(chnk) | |
|
130 | yield zd.flush() | |
|
141 | 131 | |
|
142 | return zread(f) | |
|
132 | return util.chunkbuffer(zgenerator(util.filechunkiter(f))) | |
|
143 | 133 | |
|
144 | 134 | class httpsrepository(httprepository): |
|
145 | 135 | pass |
General Comments 0
You need to be logged in to leave comments.
Login now