Release 3.6.0

This commit is contained in:
Kevin Yue committed 2026-11-19 23:44:43 +08:00
1 parent 92c19c55a3
commit eb3cebf8a9
58 files changed
+2191 -642

No files matched your search

@@ -0,0 +1,23 @@
use std::sync::Mutex;
use openconnect::{Vpn, VpnBuilder};
use crate::connect::ConnectHandler;
impl ConnectHandler<'_> {
pub(in crate::connect) fn vpn_builder(&self, server: &str, cookie: &str) -> anyhow::Result<VpnBuilder> {
let owner = self.shared_args.system_tunnel.borrow();
let tunnel = owner
.as_ref()
.ok_or_else(|| anyhow::anyhow!("System tunnel ownership is unavailable"))?;
let network = Mutex::new(tunnel.configurator()?);
Ok(
Vpn::builder(server, cookie).network_configuration_handler(move |configuration| {
network
.lock()
.map_err(|_| std::io::Error::other("Windows network state is unavailable"))?
.configure(&configuration.reason, &configuration.environment)
}),
)
}
}