mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
refactor: simplify sysproxy logic
1. close all proxies directly when reset_proxy 2. init_sysproxy and update_sysproxy combined into one 3. optimize lock usage 4 ptimize the thread loop of guard_sysproxy,
This commit is contained in:
@@ -175,7 +175,6 @@ pub async fn patch_verge(patch: IVerge) -> Result<()> {
|
||||
let mut should_update_clash_config = false;
|
||||
let mut should_update_launch = false;
|
||||
let mut should_update_sysproxy = false;
|
||||
let mut should_update_guard_proxy = false;
|
||||
let mut should_update_systray_part = false;
|
||||
|
||||
let service_mode = patch.enable_service_mode;
|
||||
@@ -214,11 +213,6 @@ pub async fn patch_verge(patch: IVerge) -> Result<()> {
|
||||
|| pac_content.is_some()
|
||||
{
|
||||
should_update_sysproxy = true;
|
||||
should_update_guard_proxy = true;
|
||||
}
|
||||
|
||||
if let Some(true) = patch.enable_proxy_guard {
|
||||
should_update_guard_proxy = true;
|
||||
}
|
||||
|
||||
if language.is_some()
|
||||
@@ -245,9 +239,6 @@ pub async fn patch_verge(patch: IVerge) -> Result<()> {
|
||||
if should_update_sysproxy {
|
||||
sysopt::Sysopt::global().update_sysproxy()?;
|
||||
}
|
||||
if should_update_guard_proxy {
|
||||
sysopt::Sysopt::global().guard_proxy();
|
||||
}
|
||||
|
||||
if let Some(hotkeys) = patch.hotkeys {
|
||||
hotkey::Hotkey::global().update(hotkeys)?;
|
||||
|
||||
Reference in New Issue
Block a user