1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-24 07:53:00 +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; act.stats.opened += 1;
if proto.is_secure() { if proto.is_secure() {
fut::Either::A( fut::Either::A(
_act.connector.connect_async(&conn.0.host, stream) act.connector.connect_async(&conn.0.host, stream)
.map_err(ClientConnectorError::SslError) .map_err(ClientConnectorError::SslError)
.map(|stream| Connection::new( .map(|stream| Connection::new(
conn.0.clone(), Some(conn), Box::new(stream))) conn.0.clone(), Some(conn), Box::new(stream)))
.into_actor(_act)) .into_actor(act))
} else { } else {
fut::Either::B(fut::ok( fut::Either::B(fut::ok(
Connection::new( Connection::new(
@ -725,11 +725,11 @@ impl Handler<Connect> for ClientConnector {
act.stats.opened += 1; act.stats.opened += 1;
if proto.is_secure() { if proto.is_secure() {
fut::Either::A( fut::Either::A(
_act.connector.connect_async(&conn.0.host, stream) act.connector.connect_async(&conn.0.host, stream)
.map_err(ClientConnectorError::SslError) .map_err(ClientConnectorError::SslError)
.map(|stream| Connection::new( .map(|stream| Connection::new(
conn.0.clone(), Some(conn), Box::new(stream))) conn.0.clone(), Some(conn), Box::new(stream)))
.into_actor(_act)) .into_actor(act))
} else { } else {
fut::Either::B(fut::ok( fut::Either::B(fut::ok(
Connection::new( Connection::new(
@ -825,7 +825,7 @@ impl fut::ActorFuture for Maintenance
act.stats.opened += 1; act.stats.opened += 1;
if conn.0.ssl { if conn.0.ssl {
fut::Either::A( fut::Either::A(
_act.connector.connect_async(&key.host, stream) act.connector.connect_async(&key.host, stream)
.then(move |res| { .then(move |res| {
match res { match res {
Err(e) => { Err(e) => {
@ -861,7 +861,7 @@ impl fut::ActorFuture for Maintenance
act.stats.opened += 1; act.stats.opened += 1;
if conn.0.ssl { if conn.0.ssl {
fut::Either::A( fut::Either::A(
_act.connector.connect_async(&conn.0.host, stream) act.connector.connect_async(&conn.0.host, stream)
.then(|res| { .then(|res| {
match res { match res {
Err(e) => { Err(e) => {
@ -877,7 +877,7 @@ impl fut::ActorFuture for Maintenance
} }
Ok(()) Ok(())
}) })
.into_actor(_act)) .into_actor(act))
} else { } else {
let _ = waiter.tx.send(Ok(Connection::new( let _ = waiter.tx.send(Ok(Connection::new(
conn.0.clone(), Some(conn), Box::new(stream)))); conn.0.clone(), Some(conn), Box::new(stream))));

View File

@ -555,8 +555,9 @@ impl<S> AsyncRead for HttpRequest<S> {}
impl<S> fmt::Debug for HttpRequest<S> { impl<S> fmt::Debug for HttpRequest<S> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let res = writeln!(f, "\nHttpRequest {:?} {}:{}", let res = writeln!(
self.as_ref().version, self.as_ref().method, self.path_decoded()); f, "\nHttpRequest {:?} {}:{}",
self.as_ref().version, self.as_ref().method, self.path_decoded());
if !self.query_string().is_empty() { if !self.query_string().is_empty() {
let _ = writeln!(f, " query: ?{:?}", self.query_string()); let _ = writeln!(f, " query: ?{:?}", self.query_string());
} }