aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/proxy.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-02-16 19:22:19 +1300
committerAldo Cortesi <aldo@nullcube.com>2011-02-16 19:22:19 +1300
commitf009770d4ca441d151b6b96c2f1142eeb8b18aba (patch)
tree4e9fe5c9377a755a1a9d2afed64b53a028c4ed47 /libmproxy/proxy.py
parent66349c97836c5885919f9fd2bce75ddd04bfc39a (diff)
downloadmitmproxy-f009770d4ca441d151b6b96c2f1142eeb8b18aba.tar.gz
mitmproxy-f009770d4ca441d151b6b96c2f1142eeb8b18aba.tar.bz2
mitmproxy-f009770d4ca441d151b6b96c2f1142eeb8b18aba.zip
Fix a bug in HTTP 1.1 pipelining that caused Requests to be over-written.
We use the ClientConnection object to tie requests, responses and errors together. This is an HTTP 1.0 assumption, but we can fix it by just making copies of the connection object when we handle multiple requests.
Diffstat (limited to 'libmproxy/proxy.py')
-rw-r--r--libmproxy/proxy.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py
index e2c25966..ff0d9a96 100644
--- a/libmproxy/proxy.py
+++ b/libmproxy/proxy.py
@@ -454,9 +454,10 @@ class ProxyHandler(SocketServer.StreamRequestHandler):
def handle(self):
cc = ClientConnection(self.client_address)
- cc.send(self.mqueue)
while not cc.close:
+ cc.send(self.mqueue)
self.handle_request(cc)
+ cc = cc.copy()
self.finish()
def handle_request(self, cc):