Fix deprecated call

This commit is contained in:
allegroai 2023-02-11 23:13:47 +02:00
parent d1020a5ae0
commit fa3cd42893
2 changed files with 4 additions and 6 deletions

View File

@ -46,8 +46,7 @@ class SingleThreadProxy(object):
self.server.listen(100) self.server.listen(100)
self.tgthost, self.tgtport = tgthost, tgtport self.tgthost, self.tgtport = tgthost, tgtport
self.buffer_size, self.delay = buffer_size, delay self.buffer_size, self.delay = buffer_size, delay
self._proxy_daemon_thread = threading.Thread(target=self.main_loop) self._proxy_daemon_thread = threading.Thread(target=self.main_loop, daemon=True)
self._proxy_daemon_thread.setDaemon(True)
self._proxy_daemon_thread.start() self._proxy_daemon_thread.start()
def main_loop(self): def main_loop(self):

View File

@ -46,8 +46,7 @@ class TcpProxy(object):
resource.setrlimit(resource.RLIMIT_NOFILE, (max(4096, soft), hard)) resource.setrlimit(resource.RLIMIT_NOFILE, (max(4096, soft), hard))
except Exception: except Exception:
pass pass
self._proxy_daemon_thread = threading.Thread(target=self.daemon) self._proxy_daemon_thread = threading.Thread(target=self.daemon, daemon=True)
self._proxy_daemon_thread.setDaemon(True)
self._proxy_daemon_thread.start() self._proxy_daemon_thread.start()
def get_thread(self): def get_thread(self):
@ -349,8 +348,8 @@ class TcpProxy(object):
self.active_local_sockets[uuid] = {'local_socket': in_socket} self.active_local_sockets[uuid] = {'local_socket': in_socket}
# check if thread is waiting # check if thread is waiting
proxy_thread = threading.Thread(target=self.start_proxy_thread, args=(in_socket, uuid, init_data)) proxy_thread = threading.Thread(
proxy_thread.setDaemon(True) target=self.start_proxy_thread, args=(in_socket, uuid, init_data), daemon=True)
self.log("Starting proxy thread " + proxy_thread.name) self.log("Starting proxy thread " + proxy_thread.name)
proxy_thread.start() proxy_thread.start()
except Exception as ex: except Exception as ex: