mirror of
https://github.com/LorenEteval/Furious.git
synced 2026-10-05 21:37:56 +03:00
Update tun2socks exitcode handling
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -15,7 +15,6 @@ def startTun2socks(*args, **kwargs):
|
||||
|
||||
class Tun2socks(Core):
|
||||
class ExitCode:
|
||||
TunnelStartFailure = 1
|
||||
# Windows shutting down
|
||||
SystemShuttingDown = 0x40010004
|
||||
|
||||
|
||||
Reference in New Issue
Block a user