hgext/largefiles/proto.py
changeset 19005 1b84047e7d16
parent 19004 6614e5e24e66
child 19006 0b3b84222a2d
--- a/hgext/largefiles/proto.py	Tue Apr 16 01:46:39 2013 +0200
+++ b/hgext/largefiles/proto.py	Tue Apr 16 01:55:57 2013 +0200
@@ -123,11 +123,9 @@
                 self._abort(error.ResponseError(_("unexpected response:"),
                                                 length))
 
-            # Mercurial doesn't close SSH connections after writing a stream
-            infile = lfutil.limitreader(stream, length)
-            for chunk in util.filechunkiter(infile, 128 * 1024):
+            # SSH streams will block if reading more than length
+            for chunk in util.filechunkiter(stream, 128 * 1024, length):
                 yield chunk
-            infile.close()
 
         @batchable
         def statlfile(self, sha):