diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-02-15 23:16:28 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-02-15 23:16:28 +0100 |
commit | c276b4294cac97c1281ce9bb4934e49d0ba970a2 (patch) | |
tree | b22da127b68be11485ba3288435495520d6d1661 /netlib/tcp.py | |
parent | a72ae4d85c08b5716cd88715081be0f1ecaeb9d4 (diff) | |
download | mitmproxy-c276b4294cac97c1281ce9bb4934e49d0ba970a2.tar.gz mitmproxy-c276b4294cac97c1281ce9bb4934e49d0ba970a2.tar.bz2 mitmproxy-c276b4294cac97c1281ce9bb4934e49d0ba970a2.zip |
allow super() on TCPServer, add thread names for better debugging
Diffstat (limited to 'netlib/tcp.py')
-rw-r--r-- | netlib/tcp.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/netlib/tcp.py b/netlib/tcp.py index 34e47999..5c351bae 100644 --- a/netlib/tcp.py +++ b/netlib/tcp.py @@ -380,7 +380,7 @@ class BaseHandler(SocketCloseMixin): -class TCPServer: +class TCPServer(object): request_queue_size = 20 def __init__(self, address): self.address = Address.wrap(address) @@ -416,7 +416,10 @@ class TCPServer: connection, client_address = self.socket.accept() t = threading.Thread( target = self.connection_thread, - args = (connection, client_address) + 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) t.start() @@ -443,7 +446,7 @@ class TCPServer: print >> fp, exc print >> fp, '-'*40 - def handle_client_connection(self, conn, client_address): # pragma: no cover + def handle_client_connection(self, conn, client_address): # pragma: no cover """ Called after client connection. """ |