From 24c4648054e4b9551af27b801e13c18fa86d8529 Mon Sep 17 00:00:00 2001 From: SimplifiedPrivacy Date: Tue, 18 Aug 2026 13:27:05 -0400 Subject: [PATCH] Bug-Typo Fix: interface_name changed to interface to match the other singbox module --- .../systemwide/encrypted_proxy/close_singbox.py | 8 ++++---- .../systemwide/encrypted_proxy/singbox_runner.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/services/networking/systemwide/encrypted_proxy/close_singbox.py b/core/services/networking/systemwide/encrypted_proxy/close_singbox.py index 83cd79e..e14ac52 100644 --- a/core/services/networking/systemwide/encrypted_proxy/close_singbox.py +++ b/core/services/networking/systemwide/encrypted_proxy/close_singbox.py @@ -150,19 +150,19 @@ def _try_known_pid_from_state(current_state: Optional[SystemState]) -> Result: return _shut_down_by_known_process_id(cast(int, pid_query.data)) -def orchestrate_closing(current_state: SystemState, interface_name: str) -> Result: +def orchestrate_closing(current_state: SystemState, interface: str) -> Result: strategies = [ lambda: _try_known_pid_from_state(current_state), lambda: _try_shutdown_by_exact_match(), - lambda: _hunt_and_kill(interface_name), + lambda: _hunt_and_kill(interface), ] quantity_of_strategies = len(strategies) for strategy in strategies: - result = _try_with_permission_fallback(strategy, interface_name) + result = _try_with_permission_fallback(strategy, interface) if result.valid: return result - if not interface_tools.exists(interface_name): + if not interface_tools.exists(interface): return Result(valid=True, message="Tunnel inactive despite strategy failure") return Result(valid=False, message=f"All {quantity_of_strategies} strategies tried, we simply can not bring down the proxy, which is still up.") diff --git a/core/services/networking/systemwide/encrypted_proxy/singbox_runner.py b/core/services/networking/systemwide/encrypted_proxy/singbox_runner.py index 967e2b1..ce410e5 100644 --- a/core/services/networking/systemwide/encrypted_proxy/singbox_runner.py +++ b/core/services/networking/systemwide/encrypted_proxy/singbox_runner.py @@ -137,7 +137,7 @@ def end_singbox() -> Result: try: killed_existing = orchestrate_closing( current_state=current_state, - interface_name=Constants.SINGBOX_TUN_IF + interface=Constants.SINGBOX_TUN_IF ) except RuntimeError as e: # Interface error raised by process_closure_tool's interface_exists return Result(valid=False, error_type=ResultError.INTERFACE, message=str(e))