aboutsummaryrefslogtreecommitdiffstats
path: root/netlib
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2014-11-07 16:01:41 +1300
committerAldo Cortesi <aldo@nullcube.com>2014-11-07 16:01:41 +1300
commit0811a9ebde4975d4e934cf4752376dd0db9bb7e4 (patch)
tree7a9e45bfdfbda84f1ea8220f83b4e7f06e2a20b9 /netlib
parent9ce2f473f6febf3738dca77b20ab9a7d3092d3d0 (diff)
downloadmitmproxy-0811a9ebde4975d4e934cf4752376dd0db9bb7e4.tar.gz
mitmproxy-0811a9ebde4975d4e934cf4752376dd0db9bb7e4.tar.bz2
mitmproxy-0811a9ebde4975d4e934cf4752376dd0db9bb7e4.zip
.flush can raise NetlibDisconnect. This fixes a traceback found in fuzzing.
Diffstat (limited to 'netlib')
-rw-r--r--netlib/tcp.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/netlib/tcp.py b/netlib/tcp.py
index 46c28cd9..6b7540aa 100644
--- a/netlib/tcp.py
+++ b/netlib/tcp.py
@@ -253,7 +253,10 @@ class _Connection(object):
# Closing the socket is not our task, therefore we don't call close then.
if type(self.connection) != SSL.Connection:
if not getattr(self.wfile, "closed", False):
- self.wfile.flush()
+ try:
+ self.wfile.flush()
+ except NetLibDisconnect:
+ pass
self.wfile.close()
self.rfile.close()