From b5179577614024685e8a95a707cb7728ce5b83f4 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Wed, 11 Apr 2018 16:34:01 -0700 Subject: [PATCH] fix stats for tls and alpn features --- src/client/connector.rs | 14 +++++++------- src/httprequest.rs | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/client/connector.rs b/src/client/connector.rs index af433be23..4993f17f8 100644 --- a/src/client/connector.rs +++ b/src/client/connector.rs @@ -702,11 +702,11 @@ impl Handler 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 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)))); diff --git a/src/httprequest.rs b/src/httprequest.rs index b4707f901..90345d050 100644 --- a/src/httprequest.rs +++ b/src/httprequest.rs @@ -555,8 +555,9 @@ impl AsyncRead for HttpRequest {} impl fmt::Debug for HttpRequest { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let res = writeln!(f, "\nHttpRequest {:?} {}:{}", - self.as_ref().version, self.as_ref().method, self.path_decoded()); + let res = writeln!( + f, "\nHttpRequest {:?} {}:{}", + self.as_ref().version, self.as_ref().method, self.path_decoded()); if !self.query_string().is_empty() { let _ = writeln!(f, " query: ?{:?}", self.query_string()); }