aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/proxy.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2013-07-30 09:42:29 +1200
committerAldo Cortesi <aldo@nullcube.com>2013-07-30 09:42:29 +1200
commit439d9a294c7df4d45b133e42edb3521901628daa (patch)
tree9aa33a65c93aefa8bdaa9e9d9636c56781af56af /libmproxy/proxy.py
parent5f0b5532bc9681c0fac8cfe821f49bff904d47be (diff)
downloadmitmproxy-439d9a294c7df4d45b133e42edb3521901628daa.tar.gz
mitmproxy-439d9a294c7df4d45b133e42edb3521901628daa.tar.bz2
mitmproxy-439d9a294c7df4d45b133e42edb3521901628daa.zip
Make use of a change to netlib.tcp that clarifies error conditions for flush and close.
Should fix #144.
Diffstat (limited to 'libmproxy/proxy.py')
-rw-r--r--libmproxy/proxy.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py
index ae5cd7d3..b1a5f084 100644
--- a/libmproxy/proxy.py
+++ b/libmproxy/proxy.py
@@ -85,12 +85,9 @@ class ServerConnection(tcp.TCPClient):
if self.connection:
try:
self.wfile.flush()
- except IOError, tcp.NetLibDisconnect: # pragma: no cover
- pass
- try:
- self.connection.close()
- except IOError:
+ except tcp.NetLibDisconnect: # pragma: no cover
pass
+ self.connection.close()