mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-18 22:16:18 -05:00
feat: add gpclient session refresh support (#595)
* Add session info events for GUI warnings * fix macOS local build * fix session expiry parsing * chore: remove session info debug logging * fix: decouple session info from vpn connect * refactor: share gpapi response helpers * fix: restore blocking session info fetch * refactor: remove service session info flow * refactor: share session protocol helpers * refactor: separate cli session runtime
This commit is contained in:
13 files changed
+800
-16
No files matched your search
@@ -159,7 +159,7 @@ mod signals {
|
||||
|
||||
pub async fn handle_signals(vpn_ctx: Arc<VpnTaskContext>, ws_ctx: Arc<WsServerContext>) {
|
||||
use gpapi::service::event::WsEvent;
|
||||
use tokio::signal::unix::{Signal, SignalKind, signal};
|
||||
use tokio::signal::unix::{signal, Signal, SignalKind};
|
||||
|
||||
let (mut user_sig1, mut user_sig2) = match || -> anyhow::Result<(Signal, Signal)> {
|
||||
let user_sig1 = signal(SignalKind::user_defined1())?;
|
||||
|
||||
@@ -9,7 +9,7 @@ use gpapi::{
|
||||
};
|
||||
use log::{info, warn};
|
||||
use openconnect::Vpn;
|
||||
use tokio::sync::{RwLock, mpsc, oneshot, watch};
|
||||
use tokio::sync::{mpsc, oneshot, watch, RwLock};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
pub(crate) struct VpnTaskContext {
|
||||
@@ -112,7 +112,6 @@ impl VpnTaskContext {
|
||||
} else {
|
||||
info!("VPN is not connected, skip disconnect");
|
||||
self.vpn_state_tx.send(VpnState::Disconnected).ok();
|
||||
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ use openconnect::{find_csd_wrapper, find_vpnc_script};
|
||||
use serde::de::DeserializeOwned;
|
||||
use tokio::{
|
||||
net::TcpListener,
|
||||
sync::{RwLock, mpsc, watch},
|
||||
sync::{mpsc, watch, RwLock},
|
||||
};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
|
||||
Reference in new issue
Block a user