mirror of
https://github.com/cjdelisle/cjdns
synced 2025-10-06 00:32:50 +02:00
Reshuffle logging a bit
This commit is contained in:
@@ -1259,7 +1259,7 @@ impl IfRecv for CiphertextRecv {
|
||||
first16.copy_from_slice(&m.pop_bytes(16)?);
|
||||
|
||||
first16.copy_from_slice(m.peek_bytes(16)?);
|
||||
log::debug!("Decrypt msg {}", m.len());
|
||||
// log::debug!("Decrypt msg {}", m.len());
|
||||
|
||||
match SessionMut::decrypt(&self.0, &mut m) {
|
||||
Ok(()) => {
|
||||
|
@@ -270,9 +270,7 @@ impl <const COUNT: usize> IoContext<COUNT> {
|
||||
i += 1;
|
||||
}
|
||||
|
||||
log::debug!("Calling recvmmsg");
|
||||
let res = recvmmsg(self.sockfd, &mut self.hdrs[0..i], libc::MSG_DONTWAIT);
|
||||
log::debug!("Calling recvmmsg done");
|
||||
|
||||
i = 0;
|
||||
for ((msg, hdr), add) in
|
||||
@@ -281,7 +279,7 @@ impl <const COUNT: usize> IoContext<COUNT> {
|
||||
if hdr.msg_len == !0 {
|
||||
break;
|
||||
}
|
||||
log::debug!("Received message");
|
||||
log::trace!("Received message");
|
||||
i += 1;
|
||||
msg.set_len(hdr.msg_len as _).unwrap();
|
||||
if self.st == SocketType::SendToFrames {
|
||||
@@ -359,14 +357,14 @@ impl<T: AsRawFd + Sync + Send + 'static> SocketIfaceInternal<T> {
|
||||
tokio::select! {
|
||||
_ = self.send_worker(n) => {},
|
||||
_ = done.recv() => {
|
||||
println!("Send worker [{n}] received done");
|
||||
log::info!("Send worker [{n}] received done");
|
||||
},
|
||||
}
|
||||
} else {
|
||||
tokio::select! {
|
||||
_ = self.recv_worker(n) => {},
|
||||
_ = done.recv() => {
|
||||
println!("Recv worker [{n}] received done");
|
||||
log::info!("Recv worker [{n}] received done");
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -467,7 +465,7 @@ impl<T: AsRawFd + Sync + Send + 'static> SocketIfaceInternal<T> {
|
||||
let mlen = msg.len();
|
||||
match self.iface.send(msg) {
|
||||
Ok(()) => {
|
||||
log::debug!("Socket receiver thread sent packet of len {mlen}");
|
||||
log::trace!("Socket receiver thread sent packet of len {mlen}");
|
||||
},
|
||||
Err(e) => {
|
||||
log::debug!("Error processing packet: {e}");
|
||||
|
@@ -77,10 +77,10 @@ impl UDPAddrIfaceInternal {
|
||||
};
|
||||
tokio::select! {
|
||||
res = self.udp.recv_from(msg.bytes_mut()) => {
|
||||
log::debug!("recv_worker got a recv_from");
|
||||
log::trace!("recv_worker got a recv_from");
|
||||
match res {
|
||||
Ok((byte_count,from)) => {
|
||||
log::debug!("Ok UDP packet from {from} with {byte_count} bytes");
|
||||
log::trace!("Ok UDP packet from {from} with {byte_count} bytes");
|
||||
if byte_count == BUFFER_CAP {
|
||||
log::warn!("Truncated incoming message from {from}");
|
||||
}
|
||||
@@ -89,7 +89,7 @@ impl UDPAddrIfaceInternal {
|
||||
msg.push_bytes(addr.bytes()).unwrap();
|
||||
match self.incoming_send.send(msg).await {
|
||||
Ok(()) => {
|
||||
log::debug!("UDP packet forwarded to receiver");
|
||||
log::trace!("UDP packet forwarded to receiver");
|
||||
}
|
||||
Err(e) => {
|
||||
log::info!("Lost message from {from} because: {e}");
|
||||
@@ -109,7 +109,7 @@ impl UDPAddrIfaceInternal {
|
||||
for msg in recv_msgs.drain(..) {
|
||||
match self.iface.send(msg) {
|
||||
Ok(()) => {
|
||||
log::debug!("UDP receiver thread sent packet successfully");
|
||||
log::trace!("UDP receiver thread sent packet successfully");
|
||||
},
|
||||
Err(e) => {
|
||||
log::debug!("Error processing packet: {e}");
|
||||
|
@@ -128,6 +128,9 @@ static void publicIPQuery(PeeringSeeder_pvt_t* pq) {
|
||||
q->onResponseContext = pq;
|
||||
q->type = SwitchPinger_Type_LLADDR;
|
||||
pq->requestOutstanding = q;
|
||||
|
||||
String_t* peerAddr = Address_toString(&tryPeer->addr, q->pingAlloc);
|
||||
Log_debug(pq->log, "Sent LlAddr query to [%s]", peerAddr->bytes);
|
||||
}
|
||||
|
||||
static void snodeResp(Dict* msg, struct Address* src, struct MsgCore_Promise* prom)
|
||||
|
Reference in New Issue
Block a user