1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 17:07:01 +02:00

Connector::Response returns addr and tcp stream

This commit is contained in:
Nikolay Kim
2018-08-27 14:20:41 -07:00
parent 3dbaef3ec1
commit c69d675113
4 changed files with 27 additions and 25 deletions

View File

@@ -115,7 +115,7 @@ impl<T> Clone for OpensslConnector<T> {
}
impl<T: AsyncRead + AsyncWrite> NewService for OpensslConnector<T> {
type Request = T;
type Request = (String, T);
type Response = SslStream<T>;
type Error = Error;
type Service = OpensslConnectorService<T>;
@@ -130,17 +130,13 @@ impl<T: AsyncRead + AsyncWrite> NewService for OpensslConnector<T> {
}
}
pub trait OpensslDomain {
fn domain(&self) -> &str;
}
pub struct OpensslConnectorService<T> {
connector: SslConnector,
io: PhantomData<T>,
}
impl<T: AsyncRead + AsyncWrite> Service for OpensslConnectorService<T> {
type Request = T;
type Request = (String, T);
type Response = SslStream<T>;
type Error = Error;
type Future = ConnectAsync<T>;
@@ -149,7 +145,7 @@ impl<T: AsyncRead + AsyncWrite> Service for OpensslConnectorService<T> {
Ok(Async::Ready(()))
}
fn call(&mut self, req: Self::Request) -> Self::Future {
SslConnectorExt::connect_async(&self.connector, "", req)
fn call(&mut self, (host, stream): Self::Request) -> Self::Future {
SslConnectorExt::connect_async(&self.connector, &host, stream)
}
}