diff options
author | 2024-02-18 17:17:17 +0800 | |
---|---|---|
committer | 2024-02-18 17:17:17 +0800 | |
commit | 4ac53a5a39e74d5eb12bee22d0fd4783acaae670 (patch) | |
tree | ca442e698e6870b7f6c5053b54fff82e2a95626e /src/lib.rs | |
parent | 7251759bdaf4b7d170575bdd6d2062bbd9f338bb (diff) | |
download | rathole-4ac53a5a39e74d5eb12bee22d0fd4783acaae670.tar.gz rathole-4ac53a5a39e74d5eb12bee22d0fd4783acaae670.tar.zst rathole-4ac53a5a39e74d5eb12bee22d0fd4783acaae670.zip |
feat: optional rustls support (#330)
* initial implementation of rustls support
* Refactor create_self_signed_cert.sh script
* resolve lint errors
* Fix handling of Option in tls.rs
* Update cargo-hack check command and feature dependencies
* fix missing point
* Add conditional check to skip test if client or server is not enabled
* clean up things
* fix for windows CI
* try fixing Windows CI
* Update src/main.rs
* Update src/transport/websocket.rs
* add missing messages
* split the tls mod
Co-authored-by: Ning Sun <n@sunng.info>
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -83,7 +83,7 @@ pub async fn run(args: Cli, shutdown_rx: broadcast::Receiver<bool>) -> Result<() if let Some((i, _)) = last_instance { info!("General configuration change detected. Restarting..."); shutdown_tx.send(true)?; - i.await?; + i.await??; } debug!("{:?}", config); @@ -119,8 +119,8 @@ async fn run_instance( args: Cli, shutdown_rx: broadcast::Receiver<bool>, service_update: mpsc::Receiver<ConfigChange>, -) { - let ret: Result<()> = match determine_run_mode(&config, &args) { +) -> Result<()> { + match determine_run_mode(&config, &args) { RunMode::Undetermine => panic!("Cannot determine running as a server or a client"), RunMode::Client => { #[cfg(not(feature = "client"))] @@ -134,8 +134,7 @@ async fn run_instance( #[cfg(feature = "server")] run_server(config, shutdown_rx, service_update).await } - }; - ret.unwrap(); + } } #[derive(PartialEq, Eq, Debug)] |