mirror of
https://github.com/fafhrd91/actix-web
synced 2025-02-17 10:13:30 +01:00
Fix build for next actix-tls-beta release (#2122)
This commit is contained in:
parent
980ecc5f07
commit
222acfd070
@ -80,11 +80,11 @@ required-features = ["rustls"]
|
|||||||
actix-codec = "0.4.0-beta.1"
|
actix-codec = "0.4.0-beta.1"
|
||||||
actix-macros = "0.2.0"
|
actix-macros = "0.2.0"
|
||||||
actix-router = "0.2.7"
|
actix-router = "0.2.7"
|
||||||
actix-rt = "2.1"
|
actix-rt = "2.2"
|
||||||
actix-server = "2.0.0-beta.3"
|
actix-server = "2.0.0-beta.3"
|
||||||
actix-service = "2.0.0-beta.4"
|
actix-service = "2.0.0-beta.4"
|
||||||
actix-utils = "3.0.0-beta.2"
|
actix-utils = "3.0.0-beta.2"
|
||||||
actix-tls = { version = "3.0.0-beta.4", default-features = false, optional = true }
|
actix-tls = { version = "3.0.0-beta.5", default-features = false, optional = true }
|
||||||
|
|
||||||
actix-web-codegen = "0.5.0-beta.2"
|
actix-web-codegen = "0.5.0-beta.2"
|
||||||
actix-http = "3.0.0-beta.4"
|
actix-http = "3.0.0-beta.4"
|
||||||
|
@ -33,5 +33,5 @@ mime_guess = "2.0.1"
|
|||||||
percent-encoding = "2.1"
|
percent-encoding = "2.1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-rt = "2.1"
|
actix-rt = "2.2"
|
||||||
actix-web = "4.0.0-beta.4"
|
actix-web = "4.0.0-beta.4"
|
||||||
|
@ -31,9 +31,9 @@ openssl = ["tls-openssl", "awc/openssl"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
actix-service = "2.0.0-beta.4"
|
actix-service = "2.0.0-beta.4"
|
||||||
actix-codec = "0.4.0-beta.1"
|
actix-codec = "0.4.0-beta.1"
|
||||||
actix-tls = "3.0.0-beta.4"
|
actix-tls = "3.0.0-beta.5"
|
||||||
actix-utils = "3.0.0-beta.2"
|
actix-utils = "3.0.0-beta.2"
|
||||||
actix-rt = "2.1"
|
actix-rt = "2.2"
|
||||||
actix-server = "2.0.0-beta.3"
|
actix-server = "2.0.0-beta.3"
|
||||||
awc = { version = "3.0.0-beta.3", default-features = false }
|
awc = { version = "3.0.0-beta.3", default-features = false }
|
||||||
|
|
||||||
|
@ -47,8 +47,8 @@ trust-dns = ["trust-dns-resolver"]
|
|||||||
actix-service = "2.0.0-beta.4"
|
actix-service = "2.0.0-beta.4"
|
||||||
actix-codec = "0.4.0-beta.1"
|
actix-codec = "0.4.0-beta.1"
|
||||||
actix-utils = "3.0.0-beta.2"
|
actix-utils = "3.0.0-beta.2"
|
||||||
actix-rt = "2.1"
|
actix-rt = "2.2"
|
||||||
actix-tls = "3.0.0-beta.4"
|
actix-tls = "3.0.0-beta.5"
|
||||||
|
|
||||||
ahash = "0.7"
|
ahash = "0.7"
|
||||||
base64 = "0.13"
|
base64 = "0.13"
|
||||||
@ -89,7 +89,7 @@ trust-dns-resolver = { version = "0.20.0", optional = true }
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-server = "2.0.0-beta.3"
|
actix-server = "2.0.0-beta.3"
|
||||||
actix-http-test = { version = "3.0.0-beta.3", features = ["openssl"] }
|
actix-http-test = { version = "3.0.0-beta.3", features = ["openssl"] }
|
||||||
actix-tls = { version = "3.0.0-beta.4", features = ["openssl"] }
|
actix-tls = { version = "3.0.0-beta.5", features = ["openssl"] }
|
||||||
criterion = "0.3"
|
criterion = "0.3"
|
||||||
env_logger = "0.8"
|
env_logger = "0.8"
|
||||||
rcgen = "0.8"
|
rcgen = "0.8"
|
||||||
|
@ -9,7 +9,7 @@ use std::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use actix_rt::{
|
use actix_rt::{
|
||||||
net::TcpStream,
|
net::{ActixStream, TcpStream},
|
||||||
time::{sleep, Sleep},
|
time::{sleep, Sleep},
|
||||||
};
|
};
|
||||||
use actix_service::Service;
|
use actix_service::Service;
|
||||||
@ -119,7 +119,7 @@ impl<S> Connector<S> {
|
|||||||
/// Use custom connector.
|
/// Use custom connector.
|
||||||
pub fn connector<S1, Io1>(self, connector: S1) -> Connector<S1>
|
pub fn connector<S1, Io1>(self, connector: S1) -> Connector<S1>
|
||||||
where
|
where
|
||||||
Io1: ConnectionIo + fmt::Debug,
|
Io1: ActixStream + fmt::Debug + 'static,
|
||||||
S1: Service<
|
S1: Service<
|
||||||
TcpConnect<Uri>,
|
TcpConnect<Uri>,
|
||||||
Response = TcpConnection<Uri, Io1>,
|
Response = TcpConnection<Uri, Io1>,
|
||||||
@ -136,7 +136,14 @@ impl<S> Connector<S> {
|
|||||||
|
|
||||||
impl<S, Io> Connector<S>
|
impl<S, Io> Connector<S>
|
||||||
where
|
where
|
||||||
Io: ConnectionIo + fmt::Debug,
|
// Note:
|
||||||
|
// Input Io type is bound to ActixStream trait but internally in client module they
|
||||||
|
// are bound to ConnectionIo trait alias. And latter is the trait exposed to public
|
||||||
|
// in the form of Box<dyn ConnectionIo> type.
|
||||||
|
//
|
||||||
|
// This remap is to hide ActixStream's trait methods. They are not meant to be called
|
||||||
|
// from user code.
|
||||||
|
Io: ActixStream + fmt::Debug + 'static,
|
||||||
S: Service<
|
S: Service<
|
||||||
TcpConnect<Uri>,
|
TcpConnect<Uri>,
|
||||||
Response = TcpConnection<Uri, Io>,
|
Response = TcpConnection<Uri, Io>,
|
||||||
@ -407,16 +414,14 @@ struct TlsConnectorService<S, St> {
|
|||||||
timeout: Duration,
|
timeout: Duration,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<S, St, Io, Res> Service<Connect> for TlsConnectorService<S, St>
|
impl<S, St, Io> Service<Connect> for TlsConnectorService<S, St>
|
||||||
where
|
where
|
||||||
S: Service<Connect, Response = TcpConnection<Uri, Io>, Error = ConnectError>
|
S: Service<Connect, Response = TcpConnection<Uri, Io>, Error = ConnectError>
|
||||||
+ Clone
|
+ Clone
|
||||||
+ 'static,
|
+ 'static,
|
||||||
St: Service<TcpConnection<Uri, Io>, Response = Res, Error = std::io::Error>
|
St: Service<TcpConnection<Uri, Io>, Error = std::io::Error> + Clone + 'static,
|
||||||
+ Clone
|
|
||||||
+ 'static,
|
|
||||||
Io: ConnectionIo,
|
Io: ConnectionIo,
|
||||||
Res: IntoConnectionIo,
|
St::Response: IntoConnectionIo,
|
||||||
{
|
{
|
||||||
type Response = (Box<dyn ConnectionIo>, Protocol);
|
type Response = (Box<dyn ConnectionIo>, Protocol);
|
||||||
type Error = ConnectError;
|
type Error = ConnectError;
|
||||||
@ -471,10 +476,10 @@ where
|
|||||||
Error = std::io::Error,
|
Error = std::io::Error,
|
||||||
Future = Fut2,
|
Future = Fut2,
|
||||||
>,
|
>,
|
||||||
|
S::Response: IntoConnectionIo,
|
||||||
Fut1: Future<Output = Result<TcpConnection<Uri, Io>, ConnectError>>,
|
Fut1: Future<Output = Result<TcpConnection<Uri, Io>, ConnectError>>,
|
||||||
Fut2: Future<Output = Result<S::Response, S::Error>>,
|
Fut2: Future<Output = Result<S::Response, S::Error>>,
|
||||||
Io: ConnectionIo,
|
Io: ConnectionIo,
|
||||||
Res: IntoConnectionIo,
|
|
||||||
{
|
{
|
||||||
type Output = Result<(Box<dyn ConnectionIo>, Protocol), ConnectError>;
|
type Output = Result<(Box<dyn ConnectionIo>, Protocol), ConnectError>;
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ mime = "0.3"
|
|||||||
twoway = "0.2"
|
twoway = "0.2"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-rt = "2.1"
|
actix-rt = "2.2"
|
||||||
actix-http = "3.0.0-beta.4"
|
actix-http = "3.0.0-beta.4"
|
||||||
tokio = { version = "1", features = ["sync"] }
|
tokio = { version = "1", features = ["sync"] }
|
||||||
tokio-stream = "0.1"
|
tokio-stream = "0.1"
|
||||||
|
@ -28,6 +28,6 @@ pin-project = "1.0.0"
|
|||||||
tokio = { version = "1", features = ["sync"] }
|
tokio = { version = "1", features = ["sync"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-rt = "2.1"
|
actix-rt = "2.2"
|
||||||
env_logger = "0.8"
|
env_logger = "0.8"
|
||||||
futures-util = { version = "0.3.7", default-features = false }
|
futures-util = { version = "0.3.7", default-features = false }
|
||||||
|
@ -19,7 +19,7 @@ syn = { version = "1", features = ["full", "parsing"] }
|
|||||||
proc-macro2 = "1"
|
proc-macro2 = "1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-rt = "2.1"
|
actix-rt = "2.2"
|
||||||
actix-web = "4.0.0-beta.4"
|
actix-web = "4.0.0-beta.4"
|
||||||
futures-util = { version = "0.3.7", default-features = false }
|
futures-util = { version = "0.3.7", default-features = false }
|
||||||
trybuild = "1"
|
trybuild = "1"
|
||||||
|
@ -71,7 +71,7 @@ actix-http = { version = "3.0.0-beta.4", features = ["openssl"] }
|
|||||||
actix-http-test = { version = "3.0.0-beta.3", features = ["openssl"] }
|
actix-http-test = { version = "3.0.0-beta.3", features = ["openssl"] }
|
||||||
actix-utils = "3.0.0-beta.1"
|
actix-utils = "3.0.0-beta.1"
|
||||||
actix-server = "2.0.0-beta.3"
|
actix-server = "2.0.0-beta.3"
|
||||||
actix-tls = { version = "3.0.0-beta.4", features = ["openssl", "rustls"] }
|
actix-tls = { version = "3.0.0-beta.5", features = ["openssl", "rustls"] }
|
||||||
|
|
||||||
brotli2 = "0.3.2"
|
brotli2 = "0.3.2"
|
||||||
env_logger = "0.8"
|
env_logger = "0.8"
|
||||||
|
@ -4,12 +4,11 @@ use std::net::IpAddr;
|
|||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use actix_codec::{AsyncRead, AsyncWrite};
|
|
||||||
use actix_http::{
|
use actix_http::{
|
||||||
client::{Connector, ConnectorService, TcpConnect, TcpConnectError, TcpConnection},
|
client::{Connector, ConnectorService, TcpConnect, TcpConnectError, TcpConnection},
|
||||||
http::{self, header, Error as HttpError, HeaderMap, HeaderName, Uri},
|
http::{self, header, Error as HttpError, HeaderMap, HeaderName, Uri},
|
||||||
};
|
};
|
||||||
use actix_rt::net::TcpStream;
|
use actix_rt::net::{ActixStream, TcpStream};
|
||||||
use actix_service::{boxed, Service};
|
use actix_service::{boxed, Service};
|
||||||
|
|
||||||
use crate::connect::DefaultConnector;
|
use crate::connect::DefaultConnector;
|
||||||
@ -64,7 +63,7 @@ where
|
|||||||
S: Service<TcpConnect<Uri>, Response = TcpConnection<Uri, Io>, Error = TcpConnectError>
|
S: Service<TcpConnect<Uri>, Response = TcpConnection<Uri, Io>, Error = TcpConnectError>
|
||||||
+ Clone
|
+ Clone
|
||||||
+ 'static,
|
+ 'static,
|
||||||
Io: AsyncRead + AsyncWrite + Unpin + fmt::Debug + 'static,
|
Io: ActixStream + fmt::Debug + 'static,
|
||||||
{
|
{
|
||||||
/// Use custom connector service.
|
/// Use custom connector service.
|
||||||
pub fn connector<S1, Io1>(self, connector: Connector<S1>) -> ClientBuilder<S1, M>
|
pub fn connector<S1, Io1>(self, connector: Connector<S1>) -> ClientBuilder<S1, M>
|
||||||
@ -75,7 +74,7 @@ where
|
|||||||
Error = TcpConnectError,
|
Error = TcpConnectError,
|
||||||
> + Clone
|
> + Clone
|
||||||
+ 'static,
|
+ 'static,
|
||||||
Io1: AsyncRead + AsyncWrite + Unpin + fmt::Debug + 'static,
|
Io1: ActixStream + fmt::Debug + 'static,
|
||||||
{
|
{
|
||||||
ClientBuilder {
|
ClientBuilder {
|
||||||
middleware: self.middleware,
|
middleware: self.middleware,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user