Break out of main peer loop on error

This commit is contained in:
Ignotus Peverell 2019-01-09 19:14:50 +00:00
parent 5915580ab3
commit 684e8164f5
No known key found for this signature in database
GPG key ID: 99CD25F39F8F8211

View file

@ -87,6 +87,7 @@ impl Server {
let sc = stream.try_clone();
if let Err(e) = self.handle_new_peer(stream) {
warn!("Error accepting peer {}: {:?}", peer_addr.to_string(), e);
break;
} else {
if let Ok(s) = sc {
connected_sockets.insert(peer_addr, s);
@ -101,6 +102,7 @@ impl Server {
}
Err(e) => {
warn!("Couldn't establish new client connection: {:?}", e);
break;
}
}
if self.stop_state.lock().is_stopped() {