mercurial/sshpeer.py
changeset 36628 70415568ea65
parent 36608 1151c731686e
child 36833 46f4d71ed505
--- a/mercurial/sshpeer.py	Sat Mar 03 05:51:34 2018 -0500
+++ b/mercurial/sshpeer.py	Fri Mar 02 22:59:12 2018 -0500
@@ -523,7 +523,11 @@
             self._abort(error.ResponseError(_("unexpected response:"), l))
 
     def _readframed(self):
-        return self._pipei.read(self._getamount())
+        size = self._getamount()
+        if not size:
+            return b''
+
+        return self._pipei.read(size)
 
     def _writeframed(self, data, flush=False):
         self._pipeo.write("%d\n" % len(data))