diff --git a/Cargo.lock b/Cargo.lock index a28032e..4d716ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,9 +2,9 @@ # It is not intended for manual editing. [[package]] name = "actix-codec" -version = "0.4.0-beta.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90673465c6187bd0829116b02be465dc0195a74d7719f76ffff0effef934a92e" +checksum = "1d5dbeb2d9e51344cb83ca7cc170f1217f9fe25bfc50160e6e200b5c31c1019a" dependencies = [ "bitflags", "bytes", diff --git a/Cargo.toml b/Cargo.toml index 8857fea..200f105 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,11 @@ include = ["src/**/*", "db_queries", "LICENSE", "README.md"] description = "A MangaDex@Home implementation in Rust." repository = "https://github.com/edward-shen/mangadex-home-rs" +[profile.release] +lto = true +codegen-units = 1 +debug = 1 + [dependencies] actix-web = { version = "4.0.0-beta.4", features = [ "rustls" ] } async-trait = "0.1" @@ -35,8 +40,3 @@ tokio = { version = "1", features = [ "full", "parking_lot" ] } tokio-stream = { version = "0.1", features = [ "sync" ] } tokio-util = { version = "0.6", features = [ "codec" ] } url = { version = "2", features = [ "serde" ] } - -[profile.release] -lto = true -codegen-units = 1 -debug = 1 \ No newline at end of file diff --git a/src/cache/disk_cache.rs b/src/cache/disk_cache.rs index 1485093..e86aef2 100644 --- a/src/cache/disk_cache.rs +++ b/src/cache/disk_cache.rs @@ -175,7 +175,6 @@ impl Cache for DiskCache { &self, key: &CacheKey, ) -> Option> { - coz::scope!("disk cache get"); let channel = self.db_update_channel_sender.clone(); let path = Arc::new(self.disk_path.clone().join(PathBuf::from(key))); diff --git a/src/main.rs b/src/main.rs index b315bd8..01640ee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -145,6 +145,7 @@ async fn main() -> Result<(), Box> { }) .shutdown_timeout(60) .bind_rustls(format!("0.0.0.0:{}", port), tls_config)? + // .bind(format!("0.0.0.0:{}", port))? .run() .await?; diff --git a/src/routes.rs b/src/routes.rs index 6d1724e..f9b10b5 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -64,7 +64,6 @@ async fn token_data( return ServerResponse::TokenValidationError(e); } } - coz::progress!(); fetch_image(state, cache, chapter_hash, file_name, false).await } diff --git a/src/state.rs b/src/state.rs index b99ad4a..dfe5bc2 100644 --- a/src/state.rs +++ b/src/state.rs @@ -6,7 +6,7 @@ use crate::ping::{Request, Response, Tls, CONTROL_CENTER_PING_URL}; use log::{error, info, warn}; use parking_lot::RwLock; use rustls::sign::CertifiedKey; -use rustls::ResolvesServerCert; +use rustls::{ClientHello, ResolvesServerCert}; use sodiumoxide::crypto::box_::PrecomputedKey; use thiserror::Error; use url::Url; @@ -126,7 +126,9 @@ impl ServerState { pub struct RwLockServerState(pub RwLock); impl ResolvesServerCert for RwLockServerState { - fn resolve(&self, _: rustls::ClientHello) -> Option { + fn resolve(&self, _: ClientHello) -> Option { + // TODO: wait for actix-web to use a new version of rustls so we can + // remove cloning the certs all the time let read_guard = self.0.read(); Some(CertifiedKey { cert: read_guard.tls_config.certs.clone(),