fix http_connector

1. use ipv4 first when connect to http server.
2. allow redirect to url like: http://tcp://p.com:11010
3. dns should also use long timeout
This commit is contained in:
sijie.sun
2025-03-08 13:19:23 +08:00
committed by Sijie.Sun
parent 00d61333d3
commit 8d654330ac
4 changed files with 29 additions and 21 deletions
+4 -1
View File
@@ -365,9 +365,12 @@ impl ManualConnectorManager {
"cannot get ip from url"
)));
for ip_version in ip_versions {
let use_long_timeout = dead_url.starts_with("http")
|| dead_url.starts_with("srv")
|| dead_url.starts_with("txt");
let ret = timeout(
// allow http connector to wait longer
std::time::Duration::from_secs(if dead_url.starts_with("http") { 20 } else { 2 }),
std::time::Duration::from_secs(if use_long_timeout { 20 } else { 2 }),
Self::conn_reconnect_with_ip_version(
data.clone(),
dead_url.clone(),