diff options
author | Marcelo Glezer <mg@tekii.com.ar> | 2015-02-05 11:29:53 -0300 |
---|---|---|
committer | Marcelo Glezer <mg@tekii.com.ar> | 2015-02-05 11:29:53 -0300 |
commit | 5cbdd21a4bf2962c855ee5c21470b7d3c733a883 (patch) | |
tree | 12ffe0ab3e8a6884c6ef226db74531b2de5c7003 /libmproxy/protocol/tcp.py | |
parent | 17ee88e07e68e19e24fd0a85b0e1d5723fd19338 (diff) | |
parent | 310fb18aac972123e0b25e618978d4dce7031078 (diff) | |
download | mitmproxy-5cbdd21a4bf2962c855ee5c21470b7d3c733a883.tar.gz mitmproxy-5cbdd21a4bf2962c855ee5c21470b7d3c733a883.tar.bz2 mitmproxy-5cbdd21a4bf2962c855ee5c21470b7d3c733a883.zip |
Merge remote-tracking branch 'base/master'
Diffstat (limited to 'libmproxy/protocol/tcp.py')
-rw-r--r-- | libmproxy/protocol/tcp.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libmproxy/protocol/tcp.py b/libmproxy/protocol/tcp.py index da0c9087..d2d21829 100644 --- a/libmproxy/protocol/tcp.py +++ b/libmproxy/protocol/tcp.py @@ -3,6 +3,7 @@ import select import socket from .primitives import ProtocolHandler from netlib.utils import cleanBin +from netlib.tcp import NetLibError class TCPHandler(ProtocolHandler): @@ -76,7 +77,8 @@ class TCPHandler(ProtocolHandler): ), "info" ) - dst.connection.send(contents) + # Do not use dst.connection.send here, which may raise OpenSSL-specific errors. + dst.send(contents) else: # socket.socket.send supports raw bytearrays/memoryviews if self.log: @@ -87,6 +89,6 @@ class TCPHandler(ProtocolHandler): "info" ) dst.connection.send(buf[:size]) - except socket.error as e: + except (socket.error, NetLibError) as e: self.c.log("TCP connection closed unexpectedly.", "debug") return |