From 21870bcccb1842d992c7570424044b1cae046ed6 Mon Sep 17 00:00:00 2001 From: ivulit Date: Mon, 23 Feb 2026 21:57:22 +0300 Subject: [PATCH] Revert "Add 10s timeout to fetch_proxy_config and download_proxy_secret" This reverts commit 39dfc07cbdb4ae1f32ec20fd678e546cdfb05d36. --- src/transport/middle_proxy/config_updater.rs | 11 +++-------- src/transport/middle_proxy/secret.rs | 8 +------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/transport/middle_proxy/config_updater.rs b/src/transport/middle_proxy/config_updater.rs index 94e934c..479a880 100644 --- a/src/transport/middle_proxy/config_updater.rs +++ b/src/transport/middle_proxy/config_updater.rs @@ -79,15 +79,10 @@ fn parse_proxy_line(line: &str) -> Option<(i32, IpAddr, u16)> { } pub async fn fetch_proxy_config(url: &str) -> Result { - let client = reqwest::Client::builder() - .timeout(Duration::from_secs(10)) - .build() - .map_err(|e| crate::error::ProxyError::Proxy(format!("fetch_proxy_config client build failed: {e}")))?; - let resp = client - .get(url) - .send() + let resp = reqwest::get(url) .await - .map_err(|e| crate::error::ProxyError::Proxy(format!("fetch_proxy_config GET failed: {e}")))?; + .map_err(|e| crate::error::ProxyError::Proxy(format!("fetch_proxy_config GET failed: {e}")))? + ; if let Some(date) = resp.headers().get(reqwest::header::DATE) { if let Ok(date_str) = date.to_str() { diff --git a/src/transport/middle_proxy/secret.rs b/src/transport/middle_proxy/secret.rs index d7824b6..a9e224d 100644 --- a/src/transport/middle_proxy/secret.rs +++ b/src/transport/middle_proxy/secret.rs @@ -54,13 +54,7 @@ pub async fn fetch_proxy_secret(cache_path: Option<&str>) -> Result> { } pub async fn download_proxy_secret() -> Result> { - let client = reqwest::Client::builder() - .timeout(Duration::from_secs(10)) - .build() - .map_err(|e| ProxyError::Proxy(format!("Failed to build reqwest client: {e}")))?; - let resp = client - .get("https://core.telegram.org/getProxySecret") - .send() + let resp = reqwest::get("https://core.telegram.org/getProxySecret") .await .map_err(|e| ProxyError::Proxy(format!("Failed to download proxy-secret: {e}")))?;