1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 10:27:42 +02:00

fix stats for tls and alpn features

This commit is contained in:
Nikolay Kim
2018-04-11 16:34:01 -07:00
parent d18f9c5905
commit b517957761
2 changed files with 10 additions and 9 deletions

View File

@ -702,11 +702,11 @@ impl Handler<Connect> for ClientConnector {
act.stats.opened += 1;
if proto.is_secure() {
fut::Either::A(
_act.connector.connect_async(&conn.0.host, stream)
act.connector.connect_async(&conn.0.host, stream)
.map_err(ClientConnectorError::SslError)
.map(|stream| Connection::new(
conn.0.clone(), Some(conn), Box::new(stream)))
.into_actor(_act))
.into_actor(act))
} else {
fut::Either::B(fut::ok(
Connection::new(
@ -725,11 +725,11 @@ impl Handler<Connect> for ClientConnector {
act.stats.opened += 1;
if proto.is_secure() {
fut::Either::A(
_act.connector.connect_async(&conn.0.host, stream)
act.connector.connect_async(&conn.0.host, stream)
.map_err(ClientConnectorError::SslError)
.map(|stream| Connection::new(
conn.0.clone(), Some(conn), Box::new(stream)))
.into_actor(_act))
.into_actor(act))
} else {
fut::Either::B(fut::ok(
Connection::new(
@ -825,7 +825,7 @@ impl fut::ActorFuture for Maintenance
act.stats.opened += 1;
if conn.0.ssl {
fut::Either::A(
_act.connector.connect_async(&key.host, stream)
act.connector.connect_async(&key.host, stream)
.then(move |res| {
match res {
Err(e) => {
@ -861,7 +861,7 @@ impl fut::ActorFuture for Maintenance
act.stats.opened += 1;
if conn.0.ssl {
fut::Either::A(
_act.connector.connect_async(&conn.0.host, stream)
act.connector.connect_async(&conn.0.host, stream)
.then(|res| {
match res {
Err(e) => {
@ -877,7 +877,7 @@ impl fut::ActorFuture for Maintenance
}
Ok(())
})
.into_actor(_act))
.into_actor(act))
} else {
let _ = waiter.tx.send(Ok(Connection::new(
conn.0.clone(), Some(conn), Box::new(stream))));