chore(gui-client): cleanup (#4836)

I noticed a few things were unused or incorrect, this fixes those
This commit is contained in:
Reactor Scram
2024-05-01 10:34:25 -05:00
committed by GitHub
parent 09f25d6e0c
commit 2721df26b5
4 changed files with 7 additions and 18 deletions

View File

@@ -40,14 +40,6 @@ mod os;
mod os;
// This syntax is odd, but it helps `cargo-mutants` understand the platform-specific modules
// The IPC implementation of TunnelWrapper is not built yet
/*
#[cfg(target_os = "linux")]
#[path = "tunnel-wrapper/ipc.rs"]
mod tunnel_wrapper_ipc;
#[cfg(target_os = "linux")]
use tunnel_wrapper_ipc as tunnel_wrapper;
*/
#[cfg(target_os = "windows")]
#[path = "tunnel-wrapper/in_proc.rs"]
mod tunnel_wrapper_in_proc;
@@ -498,7 +490,8 @@ struct Controller {
ctlr_tx: CtlrTx,
/// connlib session for the currently signed-in user, if there is one
session: Option<Session>,
logging_handles: client::logging::Handles,
/// Must be kept alive so the logger will keep running
_logging_handles: client::logging::Handles,
/// Tells us when to wake up and look for a new resource list. Tokio docs say that memory reads and writes are synchronized when notifying, so we don't need an extra mutex on the resources.
notify_controller: Arc<Notify>,
tunnel_ready: bool,
@@ -521,7 +514,6 @@ impl Controller {
let callback_handler = CallbackHandler {
ctlr_tx: self.ctlr_tx.clone(),
_logger: self.logging_handles.logger.clone(),
notify_controller: Arc::clone(&self.notify_controller),
resources: Default::default(),
};
@@ -783,7 +775,7 @@ async fn run_controller(
auth: client::auth::Auth::new().context("Failed to set up auth module")?,
ctlr_tx,
session: None,
logging_handles,
_logging_handles: logging_handles,
notify_controller: Arc::new(Notify::new()), // TODO: Fix cancel-safety
tunnel_ready: false,
uptime: Default::default(),

View File

@@ -17,7 +17,7 @@ use tracing_subscriber::{fmt, layer::SubscriberExt, reload, EnvFilter, Layer, Re
/// resulting in empty log files.
#[must_use]
pub(crate) struct Handles {
pub logger: file_logger::Handle,
pub _logger: file_logger::Handle,
pub _reloader: reload::Handle<EnvFilter, Registry>,
}
@@ -56,7 +56,7 @@ pub(crate) fn setup(log_filter: &str) -> Result<Handles, Error> {
LogTracer::init()?;
tracing::debug!(?log_path, "Log path");
Ok(Handles {
logger,
_logger: logger,
_reloader: reloader,
})
}

View File

@@ -10,7 +10,7 @@
use anyhow::{Context, Result};
use arc_swap::ArcSwap;
use connlib_client_shared::{file_logger, ResourceDescription, Sockets};
use connlib_client_shared::{ResourceDescription, Sockets};
use connlib_shared::{keypair, LoginUrl};
use secrecy::SecretString;
use std::{
@@ -31,8 +31,6 @@ const MAX_PARTITION_TIME: Duration = Duration::from_secs(60 * 60 * 24 * 30);
// This will stay in the GUI process
#[derive(Clone)]
pub(crate) struct CallbackHandler {
// This isn't used, but maybe we need to keep it alive or something.
pub _logger: file_logger::Handle,
pub notify_controller: Arc<Notify>,
pub ctlr_tx: CtlrTx,
pub resources: Arc<ArcSwap<Vec<ResourceDescription>>>,

View File

@@ -1,6 +1,6 @@
use anyhow::{Context, Result};
use arc_swap::ArcSwap;
use connlib_client_shared::{file_logger, Callbacks, ResourceDescription};
use connlib_client_shared::{Callbacks, ResourceDescription};
use firezone_headless_client::{imp::sock_path, IpcClientMsg, IpcServerMsg};
use futures::{SinkExt, StreamExt};
use secrecy::{ExposeSecret, SecretString};
@@ -19,7 +19,6 @@ use super::CtlrTx;
#[derive(Clone)]
pub(crate) struct CallbackHandler {
pub _logger: file_logger::Handle,
pub notify_controller: Arc<Notify>,
pub ctlr_tx: CtlrTx,
pub resources: Arc<ArcSwap<Vec<ResourceDescription>>>,