Changed some logging.

This commit is contained in:
Revertron
2021-04-13 23:37:10 +02:00
parent aef30818be
commit 37941103ba
+6 -2
View File
@@ -147,7 +147,11 @@ impl Network {
peers_timer = Instant::now(); peers_timer = Instant::now();
} }
} }
if !running.load(Ordering::SeqCst) {
info!("Network loop finished"); info!("Network loop finished");
} else {
panic!("Network loop has broken prematurely!");
}
}); });
Ok(()) Ok(())
} }
@@ -182,9 +186,9 @@ fn handle_connection_event(context: Arc<Mutex<Context>>, peers: &mut Peers, regi
} }
Some(peer) => { Some(peer) => {
if event.is_read_closed() { if event.is_read_closed() {
debug!("Spurious wakeup for connection {}, ignoring", token.0); //debug!("Spurious wakeup for connection {}, ignoring", token.0);
if peer.spurious() >= 3 { if peer.spurious() >= 3 {
debug!("Disconnecting socket on 3 spurious wakeups"); //debug!("Disconnecting socket on 3 spurious wakeups");
return false; return false;
} }
let interest = if let State::Message{..} = peer.get_state() { let interest = if let State::Message{..} = peer.get_state() {