Merge pull request #813 from hyperium/logs

chore(http): reduce some logs from error level
This commit is contained in:
Sean McArthur
2016-06-01 15:20:59 -07:00
2 changed files with 17 additions and 15 deletions

View File

@@ -255,7 +255,7 @@ impl<K: Key, T: Transport, H: MessageHandler<T>> Conn<K, T, H> {
}, },
Err(e) => { Err(e) => {
//TODO: send proper error codes depending on error //TODO: send proper error codes depending on error
trace!("parse eror: {:?}", e); trace!("parse error: {:?}", e);
return State::Closed; return State::Closed;
} }
}, },
@@ -274,11 +274,10 @@ impl<K: Key, T: Transport, H: MessageHandler<T>> Conn<K, T, H> {
} }
}; };
let mut s = State::Http1(http1); let mut s = State::Http1(http1);
trace!("h1 read completed, next = {:?}", next);
if let Some(next) = next { if let Some(next) = next {
s.update(next); s.update(next);
} }
trace!("h1 read completed, state = {:?}", s); trace!("Conn.on_readable State::Http1 completed, new state = {:?}", s);
let again = match s { let again = match s {
State::Http1(Http1 { reading: Reading::Body(ref encoder), .. }) => encoder.is_eof(), State::Http1(Http1 { reading: Reading::Body(ref encoder), .. }) => encoder.is_eof(),
@@ -292,10 +291,9 @@ impl<K: Key, T: Transport, H: MessageHandler<T>> Conn<K, T, H> {
} }
}, },
State::Closed => { State::Closed => {
error!("on_readable State::Closed"); trace!("on_readable State::Closed");
State::Closed State::Closed
} }
} }
} }
@@ -509,7 +507,8 @@ impl<K: Key, T: Transport, H: MessageHandler<T>> Conn<K, T, H> {
Some((self, timeout)) Some((self, timeout))
}, },
Err(e) => { Err(e) => {
error!("error reregistering: {:?}", e); trace!("error reregistering: {:?}", e);
let _ = self.on_error(e.into());
None None
} }
} }
@@ -682,7 +681,10 @@ impl<H: MessageHandler<T>, T: Transport> State<H, T> {
_ => Writing::Closed, _ => Writing::Closed,
}; };
match (reading, writing) { match (reading, writing) {
(Reading::KeepAlive, Writing::KeepAlive) => State::Init, (Reading::KeepAlive, Writing::KeepAlive) => {
//http1.handler.on_keep_alive();
State::Init
},
(reading, Writing::Chunk(chunk)) => { (reading, Writing::Chunk(chunk)) => {
State::Http1(Http1 { State::Http1(Http1 {
reading: reading, reading: reading,