mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-24 00:21:08 +01:00
fix clippy lints
This commit is contained in:
parent
92b8673475
commit
818c65af57
@ -107,7 +107,7 @@ pub async fn test_server_with_addr<F: ServiceFactory<TcpStream>>(
|
|||||||
Connector::new()
|
Connector::new()
|
||||||
.conn_lifetime(Duration::from_secs(0))
|
.conn_lifetime(Duration::from_secs(0))
|
||||||
.timeout(Duration::from_millis(30000))
|
.timeout(Duration::from_millis(30000))
|
||||||
.ssl(builder.build())
|
.openssl(builder.build())
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(not(feature = "openssl"))]
|
#[cfg(not(feature = "openssl"))]
|
||||||
|
@ -341,7 +341,7 @@ where
|
|||||||
Connector::new()
|
Connector::new()
|
||||||
.conn_lifetime(Duration::from_secs(0))
|
.conn_lifetime(Duration::from_secs(0))
|
||||||
.timeout(Duration::from_millis(30000))
|
.timeout(Duration::from_millis(30000))
|
||||||
.ssl(builder.build())
|
.openssl(builder.build())
|
||||||
}
|
}
|
||||||
#[cfg(not(feature = "openssl"))]
|
#[cfg(not(feature = "openssl"))]
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
## Unreleased - 2021-xx-xx
|
## Unreleased - 2021-xx-xx
|
||||||
|
* Rename `Connector::{ssl => openssl}`. [#2503]
|
||||||
* Improve `Client` instantiation efficiency when using `openssl` by only building connectors once. [#2503]
|
* Improve `Client` instantiation efficiency when using `openssl` by only building connectors once. [#2503]
|
||||||
|
|
||||||
[#2503]: https://github.com/actix/actix-web/pull/2503
|
[#2503]: https://github.com/actix/actix-web/pull/2503
|
||||||
|
@ -62,7 +62,7 @@ actix-codec = "0.4.1"
|
|||||||
actix-service = "2.0.0"
|
actix-service = "2.0.0"
|
||||||
actix-http = "3.0.0-beta.14"
|
actix-http = "3.0.0-beta.14"
|
||||||
actix-rt = { version = "2.1", default-features = false }
|
actix-rt = { version = "2.1", default-features = false }
|
||||||
actix-tls = { version = "3.0.0-rc.1", features = ["connect", "uri"] }
|
actix-tls = { version = "3.0.0-rc.2", features = ["connect", "uri"] }
|
||||||
actix-utils = "3.0.0"
|
actix-utils = "3.0.0"
|
||||||
|
|
||||||
ahash = "0.7"
|
ahash = "0.7"
|
||||||
|
@ -38,10 +38,10 @@ enum OurTlsConnector {
|
|||||||
Openssl(actix_tls::connect::openssl::reexports::SslConnector),
|
Openssl(actix_tls::connect::openssl::reexports::SslConnector),
|
||||||
|
|
||||||
/// Provided because building the OpenSSL context on newer versions can be very slow.
|
/// Provided because building the OpenSSL context on newer versions can be very slow.
|
||||||
/// This prevents unnecessary calls to `.build()` which constructing the client connector.
|
/// This prevents unnecessary calls to `.build()` while constructing the client connector.
|
||||||
#[cfg(feature = "openssl")]
|
#[cfg(feature = "openssl")]
|
||||||
#[allow(dead_code)] // false positive; used in build_ssl
|
#[allow(dead_code)] // false positive; used in build_ssl
|
||||||
OpensslBuilder(tls_openssl::ssl::SslConnectorBuilder),
|
OpensslBuilder(actix_tls::connect::openssl::reexports::SslConnectorBuilder),
|
||||||
|
|
||||||
#[cfg(feature = "rustls")]
|
#[cfg(feature = "rustls")]
|
||||||
Rustls(std::sync::Arc<actix_tls::connect::rustls::reexports::ClientConfig>),
|
Rustls(std::sync::Arc<actix_tls::connect::rustls::reexports::ClientConfig>),
|
||||||
@ -77,8 +77,6 @@ impl Connector<()> {
|
|||||||
Error = actix_tls::connect::ConnectError,
|
Error = actix_tls::connect::ConnectError,
|
||||||
> + Clone,
|
> + Clone,
|
||||||
> {
|
> {
|
||||||
println!("[awc] Connector::new");
|
|
||||||
|
|
||||||
Connector {
|
Connector {
|
||||||
connector: TcpConnector::new(resolver::resolver()).service(),
|
connector: TcpConnector::new(resolver::resolver()).service(),
|
||||||
config: ConnectorConfig::default(),
|
config: ConnectorConfig::default(),
|
||||||
@ -220,7 +218,6 @@ where
|
|||||||
unimplemented!("actix-http client only supports versions http/1.1 & http/2")
|
unimplemented!("actix-http client only supports versions http/1.1 & http/2")
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
println!("[awc] max_http_version");
|
|
||||||
self.tls = Connector::build_ssl(versions);
|
self.tls = Connector::build_ssl(versions);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
@ -308,6 +305,7 @@ where
|
|||||||
};
|
};
|
||||||
|
|
||||||
let tls = match self.tls {
|
let tls = match self.tls {
|
||||||
|
#[cfg(feature = "openssl")]
|
||||||
OurTlsConnector::OpensslBuilder(builder) => {
|
OurTlsConnector::OpensslBuilder(builder) => {
|
||||||
OurTlsConnector::Openssl(builder.build())
|
OurTlsConnector::Openssl(builder.build())
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ async fn test_connection_window_size() {
|
|||||||
.map_err(|e| log::error!("Can not set alpn protocol: {:?}", e));
|
.map_err(|e| log::error!("Can not set alpn protocol: {:?}", e));
|
||||||
|
|
||||||
let client = awc::Client::builder()
|
let client = awc::Client::builder()
|
||||||
.connector(awc::Connector::new().ssl(builder.build()))
|
.connector(awc::Connector::new().openssl(builder.build()))
|
||||||
.initial_window_size(100)
|
.initial_window_size(100)
|
||||||
.initial_connection_window_size(100)
|
.initial_connection_window_size(100)
|
||||||
.finish();
|
.finish();
|
||||||
|
@ -72,7 +72,7 @@ async fn test_connection_reuse_h2() {
|
|||||||
.map_err(|e| log::error!("Can not set alpn protocol: {:?}", e));
|
.map_err(|e| log::error!("Can not set alpn protocol: {:?}", e));
|
||||||
|
|
||||||
let client = awc::Client::builder()
|
let client = awc::Client::builder()
|
||||||
.connector(awc::Connector::new().ssl(builder.build()))
|
.connector(awc::Connector::new().openssl(builder.build()))
|
||||||
.finish();
|
.finish();
|
||||||
|
|
||||||
// req 1
|
// req 1
|
||||||
|
@ -121,7 +121,7 @@ async fn test_start_ssl() {
|
|||||||
let client = awc::Client::builder()
|
let client = awc::Client::builder()
|
||||||
.connector(
|
.connector(
|
||||||
awc::Connector::new()
|
awc::Connector::new()
|
||||||
.ssl(builder.build())
|
.openssl(builder.build())
|
||||||
.timeout(Duration::from_millis(100)),
|
.timeout(Duration::from_millis(100)),
|
||||||
)
|
)
|
||||||
.finish();
|
.finish();
|
||||||
|
Loading…
Reference in New Issue
Block a user