diff --git a/copyparty/httpsrv.py b/copyparty/httpsrv.py index cbd2defd..0c3795bd 100644 --- a/copyparty/httpsrv.py +++ b/copyparty/httpsrv.py @@ -278,12 +278,12 @@ class HttpSrv(object): except: pass + thrs = [] clients = list(self.clients) for cli in clients: - try: - cli.shutdown() - except: - pass + t = threading.Thread(target=cli.shutdown) + thrs.append(t) + t.start() if self.tp_q: self.stop_threads(self.tp_nthr) @@ -292,6 +292,9 @@ class HttpSrv(object): if self.tp_q.empty(): break + for t in thrs: + t.join() + self.log(self.name, "ok bye") def thr_client(self, sck: socket.socket, addr: tuple[str, int]) -> None: