aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2013-05-05 13:18:52 +1200
committerAldo Cortesi <aldo@nullcube.com>2013-05-05 13:18:52 +1200
commit9fa09cc1f98d3df7a0a7f7b3ace3168f916f8f3e (patch)
tree881520c545d97d26e2b164f4106995a10d5d0911
parent5cd7563d1243f3944c5e111de69361643de27516 (diff)
downloadmitmproxy-9fa09cc1f98d3df7a0a7f7b3ace3168f916f8f3e.tar.gz
mitmproxy-9fa09cc1f98d3df7a0a7f7b3ace3168f916f8f3e.tar.bz2
mitmproxy-9fa09cc1f98d3df7a0a7f7b3ace3168f916f8f3e.zip
Fix crash in client playback.
-rwxr-xr-xexamples/proxapp6
-rwxr-xr-xexamples/stickycookies8
-rw-r--r--libmproxy/flow.py1
-rw-r--r--setup.py9
4 files changed, 16 insertions, 8 deletions
diff --git a/examples/proxapp b/examples/proxapp
index eb5bdbb7..3a94cd55 100755
--- a/examples/proxapp
+++ b/examples/proxapp
@@ -1,8 +1,8 @@
#!/usr/bin/env python
"""
- This example shows how to graft a WSGI app onto mitmproxy. In this
- instance, we're using the Bottle framework (http://bottlepy.org/) to expose
- a single simplest-possible page.
+This example shows how to graft a WSGI app onto mitmproxy. In this
+instance, we're using the Bottle framework (http://bottlepy.org/) to expose
+a single simplest-possible page.
"""
import bottle
import os
diff --git a/examples/stickycookies b/examples/stickycookies
index b07820fc..17cd6019 100755
--- a/examples/stickycookies
+++ b/examples/stickycookies
@@ -1,9 +1,9 @@
#!/usr/bin/env python
"""
- This example builds on mitmproxy's base proxying infrastructure to
- implement functionality similar to the "sticky cookies" option. This is at
- a lower level than the Flow mechanism, so we're dealing directly with
- request and response objects.
+This example builds on mitmproxy's base proxying infrastructure to
+implement functionality similar to the "sticky cookies" option. This is at
+a lower level than the Flow mechanism, so we're dealing directly with
+request and response objects.
"""
from libmproxy import controller, proxy
import os
diff --git a/libmproxy/flow.py b/libmproxy/flow.py
index c20fa558..1d15029b 100644
--- a/libmproxy/flow.py
+++ b/libmproxy/flow.py
@@ -933,6 +933,7 @@ class ClientPlaybackState:
"""
if self.flows and not self.current:
n = self.flows.pop(0)
+ n.request.reply = controller.DummyReply()
n.request.client_conn = None
self.current = master.handle_request(n.request)
if not testing and not self.current.response:
diff --git a/setup.py b/setup.py
index d8eb7cb4..c0b95728 100644
--- a/setup.py
+++ b/setup.py
@@ -92,5 +92,12 @@ setup(
"Topic :: Internet :: Proxy Servers",
"Topic :: Software Development :: Testing"
],
- install_requires=["netlib>=%s"%version.VERSION, "urwid>=1.1", "pyasn1>0.1.2", "pyopenssl>=0.12", "PIL", "lxml"],
+ install_requires=[
+ "netlib>=%s"%version.VERSION,
+ "urwid>=1.1",
+ "pyasn1>0.1.2",
+ "pyopenssl>=0.12",
+ "PIL",
+ "lxml"
+ ],
)