mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 16:02:59 +01:00
fix connector
This commit is contained in:
parent
be2ceb7c66
commit
fb582a6bca
@ -222,8 +222,6 @@ impl SystemService for ClientConnector {}
|
||||
|
||||
impl Default for ClientConnector {
|
||||
fn default() -> ClientConnector {
|
||||
let (tx, rx) = mpsc::unbounded();
|
||||
|
||||
#[cfg(all(feature = "alpn"))]
|
||||
{
|
||||
let builder = SslConnector::builder(SslMethod::tls()).unwrap();
|
||||
@ -231,6 +229,7 @@ impl Default for ClientConnector {
|
||||
}
|
||||
#[cfg(all(feature = "tls", not(feature = "alpn")))]
|
||||
{
|
||||
let (tx, rx) = mpsc::unbounded();
|
||||
let builder = TlsConnector::builder().unwrap();
|
||||
ClientConnector {
|
||||
stats: ClientConnectorStats::default(),
|
||||
@ -253,6 +252,8 @@ impl Default for ClientConnector {
|
||||
}
|
||||
|
||||
#[cfg(not(any(feature = "alpn", feature = "tls")))]
|
||||
{
|
||||
let (tx, rx) = mpsc::unbounded();
|
||||
ClientConnector {
|
||||
stats: ClientConnectorStats::default(),
|
||||
subscriber: None,
|
||||
@ -271,6 +272,7 @@ impl Default for ClientConnector {
|
||||
paused: Paused::No,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ClientConnector {
|
||||
@ -324,8 +326,8 @@ impl ClientConnector {
|
||||
connector,
|
||||
stats: ClientConnectorStats::default(),
|
||||
subscriber: None,
|
||||
pool_tx: tx,
|
||||
pool_rx: Some(rx),
|
||||
acq_tx: tx,
|
||||
acq_rx: Some(rx),
|
||||
conn_lifetime: Duration::from_secs(75),
|
||||
conn_keep_alive: Duration::from_secs(15),
|
||||
limit: 100,
|
||||
|
Loading…
Reference in New Issue
Block a user