mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
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):
|
||||
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):
|
||||
result = ''
|
||||
while True:
|
||||
|
Loading…
Reference in New Issue
Block a user