From bbffd5134a3e7fcb6c5fb2baacdae65b13cd1369 Mon Sep 17 00:00:00 2001 From: Xlin123 Date: Fri, 15 Sep 2023 09:20:33 -0400 Subject: [PATCH] fix: major bug ( i am stupid ) --- packages/sshnpdpy/lib/sshnpdclient.py | 8 ++++---- packages/sshnpdpy/sshnpd.py | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/sshnpdpy/lib/sshnpdclient.py b/packages/sshnpdpy/lib/sshnpdclient.py index 7ca8ea49c..5ba70e14f 100644 --- a/packages/sshnpdpy/lib/sshnpdclient.py +++ b/packages/sshnpdpy/lib/sshnpdclient.py @@ -64,11 +64,11 @@ def start(self): def is_alive(self): if not self.authenticated: - return False - elif len(SSHNPDClient.threads) > 2: - return False - else: return True + elif len(SSHNPDClient.threads) >= 2 and self.ssh_client.get_transport().is_active(): + return True + else: + return False def join(self): self.closing.set() diff --git a/packages/sshnpdpy/sshnpd.py b/packages/sshnpdpy/sshnpd.py index b4257177e..e995542ec 100644 --- a/packages/sshnpdpy/sshnpd.py +++ b/packages/sshnpdpy/sshnpd.py @@ -30,6 +30,7 @@ def main(): except Exception as e: print(e) + sshnpd.join() if __name__ == "__main__":