1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-24 16:02:59 +01:00

update actix-utils

This commit is contained in:
Nikolay Kim 2019-02-03 10:50:29 -08:00
parent e70c7f2a5d
commit c9bb2116fe
2 changed files with 11 additions and 7 deletions

View File

@ -80,3 +80,7 @@ actix-server = "0.2"
actix-http-test = { path="test-server" } actix-http-test = { path="test-server" }
env_logger = "0.6" env_logger = "0.6"
serde_derive = "1.0" serde_derive = "1.0"
[patch.crates-io]
actix-utils = { git = "https://github.com/actix/actix-net.git" }
actix-service = { git = "https://github.com/actix/actix-net.git" }

View File

@ -2,7 +2,7 @@ use std::time::Duration;
use actix_codec::{AsyncRead, AsyncWrite}; use actix_codec::{AsyncRead, AsyncWrite};
use actix_connector::{Resolver, TcpConnector}; use actix_connector::{Resolver, TcpConnector};
use actix_service::{Service, ServiceExt}; use actix_service::{Apply, Service, ServiceExt};
use actix_utils::timeout::{TimeoutError, TimeoutService}; use actix_utils::timeout::{TimeoutError, TimeoutService};
use trust_dns_resolver::config::{ResolverConfig, ResolverOpts}; use trust_dns_resolver::config::{ResolverConfig, ResolverOpts};
@ -142,8 +142,8 @@ impl Connector {
> + Clone { > + Clone {
#[cfg(not(feature = "ssl"))] #[cfg(not(feature = "ssl"))]
{ {
let connector = TimeoutService::new( let connector = Apply::new(
self.timeout, TimeoutService::new(self.timeout),
self.resolver.map_err(ConnectorError::from).and_then( self.resolver.map_err(ConnectorError::from).and_then(
TcpConnector::default() TcpConnector::default()
.from_err() .from_err()
@ -167,8 +167,8 @@ impl Connector {
} }
#[cfg(feature = "ssl")] #[cfg(feature = "ssl")]
{ {
let ssl_service = TimeoutService::new( let ssl_service = Apply::new(
self.timeout, TimeoutService::new(self.timeout),
self.resolver self.resolver
.clone() .clone()
.map_err(ConnectorError::from) .map_err(ConnectorError::from)
@ -196,8 +196,8 @@ impl Connector {
TimeoutError::Timeout => ConnectorError::Timeout, TimeoutError::Timeout => ConnectorError::Timeout,
}); });
let tcp_service = TimeoutService::new( let tcp_service = Apply::new(
self.timeout, TimeoutService::new(self.timeout),
self.resolver.map_err(ConnectorError::from).and_then( self.resolver.map_err(ConnectorError::from).and_then(
TcpConnector::default() TcpConnector::default()
.from_err() .from_err()