mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-12-04 21:30:06 +08:00
refactor(service)!: require the bundled epoch 3 service
This commit is contained in:
@@ -390,10 +390,10 @@ fn service_proxy_config(verge: &IVerge, mixed_port: u16, pac_port: u16) -> Resul
|
||||
/// the write's, so it stays a failure.
|
||||
fn service_apply_result(requested: &MacosProxyConfig, outcome: ProxyApplyOutcome) -> Result<()> {
|
||||
match outcome {
|
||||
ProxyApplyOutcome::Applied | ProxyApplyOutcome::NotRequested => Ok(()),
|
||||
ProxyApplyOutcome::Applied => Ok(()),
|
||||
// Direct fallback satisfies a disable request.
|
||||
ProxyApplyOutcome::DirectFallback { .. } if matches!(requested, MacosProxyConfig::Disabled) => Ok(()),
|
||||
// Older helpers encode a failed service lookup as fallback even when no OS write occurred.
|
||||
// The service reports a missing network service as fallback before any OS write.
|
||||
#[cfg(target_os = "macos")]
|
||||
ProxyApplyOutcome::DirectFallback { message }
|
||||
if message == sysproxy::Error::NoActiveNetworkService.to_string() =>
|
||||
|
||||
@@ -705,7 +705,6 @@ async fn start_with_existing_service(
|
||||
Ok::<_, anyhow::Error>(StartClashRequest {
|
||||
runtime: collect_service_runtime_bundle(config_file).await?,
|
||||
proposed_session_token: generate_service_session_token()?,
|
||||
macos_proxy: None,
|
||||
})
|
||||
})
|
||||
.await?;
|
||||
@@ -763,9 +762,9 @@ async fn start_with_existing_service(
|
||||
}
|
||||
|
||||
let result = response.data.context("Clash Verge Service 未返回会话信息")?;
|
||||
tracing::Span::current().record("generation", result.session.generation);
|
||||
tracing::Span::current().record("generation", result.generation);
|
||||
*ACTIVE_SERVICE_SESSION.lock() = Some(Arc::new(OwnerSessionProof {
|
||||
generation: result.session.generation,
|
||||
generation: result.generation,
|
||||
token: request.proposed_session_token.clone(),
|
||||
}));
|
||||
|
||||
@@ -779,7 +778,7 @@ async fn start_with_existing_service(
|
||||
info,
|
||||
Type::Service,
|
||||
"服务成功启动核心 (session generation {})",
|
||||
result.session.generation
|
||||
result.generation
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user