mirror of https://github.com/telemt/telemt.git
Revert "Add 10s timeout to fetch_proxy_config and download_proxy_secret"
This reverts commit 39dfc07cbd.
This commit is contained in:
parent
17fd20506e
commit
21870bcccb
|
|
@ -79,15 +79,10 @@ fn parse_proxy_line(line: &str) -> Option<(i32, IpAddr, u16)> {
|
|||
}
|
||||
|
||||
pub async fn fetch_proxy_config(url: &str) -> Result<ProxyConfigData> {
|
||||
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() {
|
||||
|
|
|
|||
|
|
@ -54,13 +54,7 @@ pub async fn fetch_proxy_secret(cache_path: Option<&str>) -> Result<Vec<u8>> {
|
|||
}
|
||||
|
||||
pub async fn download_proxy_secret() -> Result<Vec<u8>> {
|
||||
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}")))?;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue