diff options
author | Aldo Cortesi <aldo@corte.si> | 2016-06-11 22:22:02 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-11 22:22:02 +1200 |
commit | 8489c01ac81479e48c2ff2c3ab308e07e3d2bacd (patch) | |
tree | 589a0bc2d7c4134ef77459275246836da9f9fe07 /netlib/tcp.py | |
parent | 4831e3e0bcd6dc94c84df3dd224c354732bd3655 (diff) | |
parent | 53b2fd545b104051e0697c590cf7df5c37074170 (diff) | |
download | mitmproxy-8489c01ac81479e48c2ff2c3ab308e07e3d2bacd.tar.gz mitmproxy-8489c01ac81479e48c2ff2c3ab308e07e3d2bacd.tar.bz2 mitmproxy-8489c01ac81479e48c2ff2c3ab308e07e3d2bacd.zip |
Merge pull request #1241 from cortesi/debug
Debug
Diffstat (limited to 'netlib/tcp.py')
-rw-r--r-- | netlib/tcp.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/netlib/tcp.py b/netlib/tcp.py index 0eec326b..acd67cad 100644 --- a/netlib/tcp.py +++ b/netlib/tcp.py @@ -17,7 +17,11 @@ import six import OpenSSL from OpenSSL import SSL -from netlib import certutils, version_check, basetypes, exceptions +from netlib import certutils +from netlib import version_check +from netlib import basetypes +from netlib import exceptions +from netlib import basethread # This is a rather hackish way to make sure that # the latest version of pyOpenSSL is actually installed. @@ -900,12 +904,16 @@ class TCPServer(object): raise if self.socket in r: connection, client_address = self.socket.accept() - t = threading.Thread( + t = basethread.BaseThread( + "TCPConnectionHandler (%s: %s:%s -> %s:%s)" % ( + self.__class__.__name__, + client_address[0], + client_address[1], + self.address.host, + self.address.port + ), target=self.connection_thread, args=(connection, client_address), - name="ConnectionThread (%s:%s -> %s:%s)" % - (client_address[0], client_address[1], - self.address.host, self.address.port) ) t.setDaemon(1) try: |