1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-28 01:32:57 +01: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))));

View File

@ -555,7 +555,8 @@ impl<S> AsyncRead for HttpRequest<S> {}
impl<S> fmt::Debug for HttpRequest<S> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let res = writeln!(f, "\nHttpRequest {:?} {}:{}",
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());