aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Nordström <henrik@hlaptop.localdomain>2010-09-05 21:04:22 +0800
committerAldo Cortesi <aldo@nullcube.com>2010-09-06 07:18:11 +0800
commit2e7e9f9759bab5253a008cdabe0df42551bae922 (patch)
tree08fb5974e008a7ca86a27f42549460c8dacc26f0
parente98a035540559c766dddaff44b7327ab828f3672 (diff)
downloadmitmproxy-2e7e9f9759bab5253a008cdabe0df42551bae922.tar.gz
mitmproxy-2e7e9f9759bab5253a008cdabe0df42551bae922.tar.bz2
mitmproxy-2e7e9f9759bab5253a008cdabe0df42551bae922.zip
Wrap read request, concatenating partial reads until whole request have been read
-rw-r--r--libmproxy/proxy.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py
index 6196dc0e..e7a10d60 100644
--- a/libmproxy/proxy.py
+++ b/libmproxy/proxy.py
@@ -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: