Wrap read request, concatenating partial reads until whole request have been read
This commit is contained in:
parent
e98a035540
commit
2e7e9f9759
|
@ -192,6 +192,15 @@ class FileLike:
|
||||||
def flush(self):
|
def flush(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def read(self, length):
|
||||||
|
result = ''
|
||||||
|
while len(result) < length:
|
||||||
|
data = self.o.read(length)
|
||||||
|
if not data:
|
||||||
|
break
|
||||||
|
result += data
|
||||||
|
return result
|
||||||
|
|
||||||
def readline(self):
|
def readline(self):
|
||||||
result = ''
|
result = ''
|
||||||
while True:
|
while True:
|
||||||
|
|
Loading…
Reference in New Issue