mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-04-02 18:31:50 -04:00
refactor: return error when failed to connect
This commit is contained in:
parent
2136c3aa25
commit
9b9ac7fc8a
@ -103,16 +103,16 @@ impl Vpn {
|
||||
status_holder.blocking_lock().set(VpnStatus::Disconnected);
|
||||
});
|
||||
|
||||
info!("Waiting for the VPN connection...");
|
||||
info!("Waiting for the VPN to connect...");
|
||||
|
||||
if let Some(cmd_pipe_fd) = vpn_rx.recv().await {
|
||||
info!("VPN connection started, cmd_pipe_fd: {}", cmd_pipe_fd);
|
||||
self.status_holder.lock().await.set(VpnStatus::Connected);
|
||||
Ok(())
|
||||
} else {
|
||||
warn!("VPN connection failed to start");
|
||||
Err("VPN connection failed to start".into())
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn disconnect(&self) {
|
||||
|
Loading…
Reference in New Issue
Block a user