diff --git a/ntex-net/src/rt_polling/driver.rs b/ntex-net/src/rt_polling/driver.rs index c5937b5a..c179a77a 100644 --- a/ntex-net/src/rt_polling/driver.rs +++ b/ntex-net/src/rt_polling/driver.rs @@ -190,7 +190,13 @@ impl Handler for StreamOpsHandler { fn error(&mut self, id: usize, err: io::Error) { self.inner.with(|streams| { if let Some(item) = streams.get_mut(id) { - log::debug!("FD is failed ({}) {:?}, err: {:?}", id, item.fd, err); + log::debug!( + "{}: FD is failed ({}) {:?}, err: {:?}", + item.tag(), + id, + item.fd, + err + ); item.context.stopped(Some(err)); if item.io.take().is_some() { close(id as u32, item, &self.inner.api); diff --git a/ntex-net/src/rt_uring/driver.rs b/ntex-net/src/rt_uring/driver.rs index f2a88d11..d39d69e8 100644 --- a/ntex-net/src/rt_uring/driver.rs +++ b/ntex-net/src/rt_uring/driver.rs @@ -33,6 +33,12 @@ struct StreamItem { wr_op: Option, } +impl StreamItem { + fn tag(&self) -> &'static str { + self.context.tag() + } +} + enum Operation { Recv { id: usize, @@ -249,7 +255,7 @@ impl Handler for StreamOpsHandler { if storage.streams[id].ref_count == 0 { let mut item = storage.streams.remove(id); - log::debug!("{}: Drop io ({}), {:?}", item.context.tag(), id, item.fd); + log::debug!("{}: Drop io ({}), {:?}", item.tag(), id, item.fd); if let Some(io) = item.io.take() { mem::forget(io); @@ -273,7 +279,7 @@ impl StreamOpsStorage { if let Poll::Ready(mut buf) = item.context.get_read_buf() { log::debug!( "{}: Recv resume ({}), {:?} rem: {:?}", - item.context.tag(), + item.tag(), id, item.fd, buf.remaining_mut() @@ -306,7 +312,7 @@ impl StreamOpsStorage { if let Poll::Ready(buf) = item.context.get_write_buf() { log::debug!( "{}: Send resume ({}), {:?} len: {:?}", - item.context.tag(), + item.tag(), id, item.fd, buf.len() @@ -396,12 +402,7 @@ impl StreamCtl { if let Some(rd_op) = item.rd_op { if !item.flags.contains(Flags::RD_CANCELING) { - log::debug!( - "{}: Recv to pause ({}), {:?}", - item.context.tag(), - self.id, - item.fd - ); + log::debug!("{}: Recv to pause ({}), {:?}", item.tag(), self.id, item.fd); item.flags.insert(Flags::RD_CANCELING); self.inner.api.cancel(rd_op.get()); } @@ -426,12 +427,7 @@ impl Drop for StreamCtl { if storage.streams[self.id].ref_count == 0 { let mut item = storage.streams.remove(self.id); if let Some(io) = item.io.take() { - log::debug!( - "{}: Close io ({}), {:?}", - item.context.tag(), - self.id, - item.fd - ); + log::debug!("{}: Close io ({}), {:?}", item.tag(), self.id, item.fd); mem::forget(io); let id = storage.ops.insert(Operation::Close { tx: None }); diff --git a/ntex-server/src/manager.rs b/ntex-server/src/manager.rs index bc9153c3..ca558a54 100644 --- a/ntex-server/src/manager.rs +++ b/ntex-server/src/manager.rs @@ -184,10 +184,8 @@ impl HandleCmdState { if self.next > self.workers.len() { self.next = self.workers.len() - 1; } - log::debug!("--------- SENDING ITEM"); match self.workers[self.next].send(item) { Ok(()) => { - log::debug!("--------- ITEM SENT"); self.next = (self.next + 1) % self.workers.len(); break; }