Revert back to reqwest, using rustls feature (#6041)

* Revert back to reqwest, using rustls feature

* Cargo.lock and crate-features

* Ignore test
This commit is contained in:
Tyera Eulberg
2019-09-24 14:10:59 -06:00
committed by GitHub
parent 571dc4e387
commit 7babfd00c1
19 changed files with 348 additions and 169 deletions

View File

@@ -12,9 +12,9 @@ edition = "2018"
env_logger = "0.6.2"
lazy_static = "1.4.0"
log = "0.4.8"
reqwest = { version = "0.9.20", default-features = false, features = ["rustls-tls"] }
solana-sdk = { path = "../sdk", version = "0.20.0" }
sys-info = "0.5.8"
ureq = "0.11.1"
[dev-dependencies]
rand = "0.6.5"

View File

@@ -97,16 +97,20 @@ impl MetricsWriter for InfluxDbMetricsWriter {
line.push_str(&format!(" {}\n", &point.timestamp));
}
let response = ureq::post(write_url.as_str())
.timeout_connect(2_000)
.timeout_read(2_000)
.timeout_write(4_000)
.send_string(&line);
info!(
"submit response: {} {}",
response.status(),
response.status_text()
);
let client = reqwest::Client::builder()
.timeout(Duration::from_secs(5))
.build()
.unwrap();
let response = client.post(write_url.as_str()).body(line).send();
if let Ok(mut resp) = response {
info!(
"submit response: {} {}",
resp.status(),
resp.text().unwrap()
);
} else {
error!("submit error: {}", response.unwrap_err());
}
}
}
}
@@ -399,9 +403,9 @@ pub fn query(q: &str) -> Result<String, String> {
&config.host, &config.username, &config.password, &q
);
let response = ureq::get(query_url.as_str())
.call()
.into_string()
let response = reqwest::get(query_url.as_str())
.map_err(|err| err.to_string())?
.text()
.map_err(|err| err.to_string())?;
Ok(response)