Bump reqwest from 0.9.24 to 0.10.0 (#7642)

* Bump reqwest from 0.9.24 to 0.10.0

Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.9.24 to 0.10.0.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Make reqwest::blocking specific

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
This commit is contained in:
dependabot-preview[bot]
2020-01-08 13:31:43 -07:00
committed by Tyera Eulberg
parent 07855e3125
commit 57858b8015
18 changed files with 487 additions and 107 deletions

View File

@ -15,7 +15,7 @@ jsonrpc-core = "14.0.5"
log = "0.4.8"
rand = "0.6.5"
rayon = "1.2.0"
reqwest = { version = "0.9.24", default-features = false, features = ["rustls-tls"] }
reqwest = { version = "0.10.0", default-features = false, features = ["blocking", "rustls-tls"] }
serde = "1.0.104"
serde_derive = "1.0.103"
serde_json = "1.0.44"

View File

@ -9,20 +9,20 @@ use solana_sdk::clock::{DEFAULT_TICKS_PER_SECOND, DEFAULT_TICKS_PER_SLOT};
use std::{thread::sleep, time::Duration};
pub struct RpcClientRequest {
client: reqwest::Client,
client: reqwest::blocking::Client,
url: String,
}
impl RpcClientRequest {
pub fn new(url: String) -> Self {
Self {
client: reqwest::Client::new(),
client: reqwest::blocking::Client::new(),
url,
}
}
pub fn new_with_timeout(url: String, timeout: Duration) -> Self {
let client = reqwest::Client::builder()
let client = reqwest::blocking::Client::builder()
.timeout(timeout)
.build()
.expect("build rpc client");
@ -51,7 +51,7 @@ impl GenericRpcClientRequest for RpcClientRequest {
.body(request_json.to_string())
.send()
{
Ok(mut response) => {
Ok(response) => {
if !response.status().is_success() {
return Err(response.error_for_status().unwrap_err().into());
}