1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 22:49:21 +02:00

remove actix_http::client::pool::Protocol (#2061)

This commit is contained in:
fakeshadow
2021-03-09 17:31:50 -08:00
committed by GitHub
parent b62da7e86b
commit d0c1f1a84c
3 changed files with 10 additions and 39 deletions

View File

@ -20,8 +20,9 @@ use http::Uri;
use super::config::ConnectorConfig;
use super::connection::{Connection, EitherIoConnection};
use super::error::ConnectError;
use super::pool::{ConnectionPool, Protocol};
use super::pool::ConnectionPool;
use super::Connect;
use super::Protocol;
#[cfg(feature = "openssl")]
use actix_tls::connect::ssl::openssl::SslConnector as OpensslConnector;
@ -148,7 +149,7 @@ where
+ 'static,
{
/// Connection timeout, i.e. max time to connect to remote host including dns name resolution.
/// Set to 1 second by default.
/// Set to 5 second by default.
pub fn timeout(mut self, timeout: Duration) -> Self {
self.config.timeout = timeout;
self
@ -162,6 +163,7 @@ where
}
#[cfg(feature = "rustls")]
/// Use custom `SslConnector` instance.
pub fn rustls(mut self, connector: Arc<ClientConfig>) -> Self {
self.ssl = SslConnector::Rustls(connector);
self
@ -254,8 +256,7 @@ where
/// its combinator chain.
pub fn finish(
self,
) -> impl Service<Connect, Response = impl Connection, Error = ConnectError> + Clone
{
) -> impl Service<Connect, Response = impl Connection, Error = ConnectError> {
let local_address = self.config.local_address;
let timeout = self.config.timeout;
@ -392,21 +393,6 @@ where
tls_pool: Option<ConnectionPool<S2, Io2>>,
}
impl<S1, S2, Io1, Io2> Clone for InnerConnector<S1, S2, Io1, Io2>
where
S1: Service<Connect, Response = (Io1, Protocol), Error = ConnectError> + 'static,
S2: Service<Connect, Response = (Io2, Protocol), Error = ConnectError> + 'static,
Io1: AsyncRead + AsyncWrite + Unpin + 'static,
Io2: AsyncRead + AsyncWrite + Unpin + 'static,
{
fn clone(&self) -> Self {
InnerConnector {
tcp_pool: self.tcp_pool.clone(),
tls_pool: self.tls_pool.as_ref().cloned(),
}
}
}
impl<S1, S2, Io1, Io2> Service<Connect> for InnerConnector<S1, S2, Io1, Io2>
where
S1: Service<Connect, Response = (Io1, Protocol), Error = ConnectError> + 'static,