changeset 13456:ab3f4ee48adc stable

changegroup: don't accept streams without proper termination Streams should be terminated with a zero size changegroup, and read should never be permitted to return less than requested.
author Mads Kiilerich <mads@kiilerich.com>
date Tue, 22 Feb 2011 03:02:50 +0100
parents 053c042118bc
children e74fe15dc7fd
files mercurial/changegroup.py
diffstat 1 files changed, 0 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changegroup.py	Mon Feb 21 20:58:54 2011 -0300
+++ b/mercurial/changegroup.py	Tue Feb 22 03:02:50 2011 +0100
@@ -12,8 +12,6 @@
 def getchunk(source):
     """return the next chunk from changegroup 'source' as a string"""
     d = source.read(4)
-    if not d:
-        return ""
     l = struct.unpack(">l", d)[0]
     if l <= 4:
         return ""
@@ -148,8 +146,6 @@
 
     def chunklength(self):
         d = self.read(4)
-        if not d:
-            return 0
         l = max(0, struct.unpack(">l", d)[0] - 4)
         if l and self.callback:
             self.callback()