mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-02-07 02:28:50 +00:00
fail gracefully if we cannot start a new thread
This commit is contained in:
parent
d5eff70b6e
commit
6fbe3006af
@ -560,7 +560,11 @@ class TCPServer(object):
|
||||
self.address.host, self.address.port)
|
||||
)
|
||||
t.setDaemon(1)
|
||||
t.start()
|
||||
try:
|
||||
t.start()
|
||||
except threading.ThreadError:
|
||||
self.handle_error(connection, Address(client_address))
|
||||
connection.close()
|
||||
finally:
|
||||
self.__shutdown_request = False
|
||||
self.__is_shut_down.set()
|
||||
|
Loading…
Reference in New Issue
Block a user