aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/tcp.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2013-01-27 19:21:18 +1300
committerAldo Cortesi <aldo@nullcube.com>2013-01-27 19:21:18 +1300
commit7d185356655fa2f40c452c273a3cd039360d20c1 (patch)
treec49f8709d2c7e3942e6911cf0fd4ddbd33b919c0 /netlib/tcp.py
parent7433dfceae3b2ac7e709fbcedd9e298800d2ac1b (diff)
downloadmitmproxy-7d185356655fa2f40c452c273a3cd039360d20c1.tar.gz
mitmproxy-7d185356655fa2f40c452c273a3cd039360d20c1.tar.bz2
mitmproxy-7d185356655fa2f40c452c273a3cd039360d20c1.zip
100% test coverage
Diffstat (limited to 'netlib/tcp.py')
-rw-r--r--netlib/tcp.py21
1 files changed, 7 insertions, 14 deletions
diff --git a/netlib/tcp.py b/netlib/tcp.py
index 40bd4bde..556f97ac 100644
--- a/netlib/tcp.py
+++ b/netlib/tcp.py
@@ -355,20 +355,13 @@ class TCPServer:
while not self.__shutdown_request:
r, w, e = select.select([self.socket], [], [], poll_interval)
if self.socket in r:
- try:
- request, client_address = self.socket.accept()
- except socket.error:
- return
- try:
- t = threading.Thread(
- target = self.request_thread,
- args = (request, client_address)
- )
- t.setDaemon(1)
- t.start()
- except:
- self.handle_error(request, client_address)
- request.close()
+ request, client_address = self.socket.accept()
+ t = threading.Thread(
+ target = self.request_thread,
+ args = (request, client_address)
+ )
+ t.setDaemon(1)
+ t.start()
finally:
self.__shutdown_request = False
self.__is_shut_down.set()