Fix termiantion error in file read.

This commit is contained in:
Aldo Cortesi 2012-06-27 12:11:55 +12:00
parent abe335e57d
commit d0fd8385e6

View File

@ -17,7 +17,7 @@ class FileLike:
def read(self, length):
result = ''
while len(result) < length:
while length > 0:
try:
data = self.o.read(length)
except (SSL.ZeroReturnError, SSL.SysCallError):
@ -25,6 +25,7 @@ class FileLike:
if not data:
break
result += data
length -= len(data)
return result
def write(self, v):