aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/protocol2/transparent_proxy.py
diff options
context:
space:
mode:
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