From 38ed89528b36cefc4b10c64ec8b89560f1fb87bc Mon Sep 17 00:00:00 2001 From: Loren Eteval Date: Wed, 6 Sep 2023 16:01:22 +0800 Subject: [PATCH] Update tun2socks exitcode handling Signed-off-by: Loren Eteval --- Furious/Action/Connect.py | 18 ++---------------- Furious/Core/Tun2socks.py | 1 - 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/Furious/Action/Connect.py b/Furious/Action/Connect.py index 436563d..0d778e3 100644 --- a/Furious/Action/Connect.py +++ b/Furious/Action/Connect.py @@ -229,29 +229,15 @@ class ConnectAction(Action): # System shutting down. Do nothing return - if exitcode == Tun2socks.ExitCode.TunnelStartFailure: - if not self.isConnecting(): - # Protect connecting action. Mandatory - return self.disconnectAction( - f'{Hysteria.name()}: {_("Connection to server has been lost")}' - ) - else: - self.coreRunning = False - self.disconnectReason = ( - f'{Hysteria.name()}: {_("Connection to server has been lost")}' - ) - - return - if not self.isConnecting(): # Protect connecting action. Mandatory self.disconnectAction( - f'{Hysteria.name()}: {_("Core terminated unexpectedly")}' + f'{Tun2socks.name()}: {_("Core terminated unexpectedly")}' ) else: self.coreRunning = False self.disconnectReason = ( - f'{Hysteria.name()}: {_("Core terminated unexpectedly")}' + f'{Tun2socks.name()}: {_("Core terminated unexpectedly")}' ) def stopCore(self): diff --git a/Furious/Core/Tun2socks.py b/Furious/Core/Tun2socks.py index 12f28a7..af3ff3f 100644 --- a/Furious/Core/Tun2socks.py +++ b/Furious/Core/Tun2socks.py @@ -15,7 +15,6 @@ def startTun2socks(*args, **kwargs): class Tun2socks(Core): class ExitCode: - TunnelStartFailure = 1 # Windows shutting down SystemShuttingDown = 0x40010004