aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/protocol2/transparent_proxy.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-08-18 15:59:44 +0200
committerMaximilian Hils <git@maximilianhils.com>2015-08-18 15:59:44 +0200
commitab1549e0eff98588211346aada44549311f04938 (patch)
treed5fa78c1d639d5f63f60b637821496c05ec1da18 /libmproxy/protocol2/transparent_proxy.py
parent96de7ad562da9b5110059988b851c66b51874510 (diff)
downloadmitmproxy-ab1549e0eff98588211346aada44549311f04938.tar.gz
mitmproxy-ab1549e0eff98588211346aada44549311f04938.tar.bz2
mitmproxy-ab1549e0eff98588211346aada44549311f04938.zip
yield -> callbacks
Diffstat (limited to 'libmproxy/protocol2/transparent_proxy.py')
-rw-r--r--libmproxy/protocol2/transparent_proxy.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/libmproxy/protocol2/transparent_proxy.py b/libmproxy/protocol2/transparent_proxy.py
index 28ad3726..9263dbde 100644
--- a/libmproxy/protocol2/transparent_proxy.py
+++ b/libmproxy/protocol2/transparent_proxy.py
@@ -18,8 +18,8 @@ class TransparentProxy(Layer, ServerConnectionMixin):
raise ProtocolException("Transparent mode failure: %s" % repr(e), e)
layer = self.ctx.next_layer(self)
- for message in layer():
- if not self._handle_server_message(message):
- yield message
- if self.server_conn:
- self._disconnect() \ No newline at end of file
+ try:
+ layer()
+ finally:
+ if self.server_conn:
+ self._disconnect() \ No newline at end of file