precise network attacks metric
This commit is contained in:
parent
334b600a2d
commit
4d93229f19
@ -89,7 +89,9 @@ impl ConnManager {
|
|||||||
let rx_stream = BroadcastStream::new(rx).filter_map(|n| n.ok());
|
let rx_stream = BroadcastStream::new(rx).filter_map(|n| n.ok());
|
||||||
let response = client.get_updates(rx_stream).await.map_err(|e| {
|
let response = client.get_updates(rx_stream).await.map_err(|e| {
|
||||||
println!("Error connecting to {node_ip}: {e}");
|
println!("Error connecting to {node_ip}: {e}");
|
||||||
|
if e.to_string().contains("QuoteVerifyError") {
|
||||||
self.state.increase_net_attacks();
|
self.state.increase_net_attacks();
|
||||||
|
}
|
||||||
e
|
e
|
||||||
})?;
|
})?;
|
||||||
let mut resp_stream = response.into_inner();
|
let mut resp_stream = response.into_inner();
|
||||||
@ -159,7 +161,9 @@ pub async fn key_grabber(
|
|||||||
|
|
||||||
let response = client.get_keys(tonic::Request::new(Empty {})).await.map_err(|e| {
|
let response = client.get_keys(tonic::Request::new(Empty {})).await.map_err(|e| {
|
||||||
println!("Error getting keys from {node_ip}: {e}");
|
println!("Error getting keys from {node_ip}: {e}");
|
||||||
|
if e.to_string().contains("QuoteVerifyError") {
|
||||||
state.increase_net_attacks();
|
state.increase_net_attacks();
|
||||||
|
}
|
||||||
e
|
e
|
||||||
})?;
|
})?;
|
||||||
Ok(response.into_inner())
|
Ok(response.into_inner())
|
||||||
|
@ -55,7 +55,6 @@ impl MyServer {
|
|||||||
Ok(incoming) => incoming,
|
Ok(incoming) => incoming,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("Error accepting connection: {}", e);
|
println!("Error accepting connection: {}", e);
|
||||||
state.increase_net_attacks();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -79,8 +78,10 @@ impl MyServer {
|
|||||||
.await;
|
.await;
|
||||||
|
|
||||||
let conn = if let Err(e) = conn {
|
let conn = if let Err(e) = conn {
|
||||||
println!("Error accepting TLS connection: {}", e);
|
println!("Error accepting TLS connection: {e}");
|
||||||
|
if e.to_string().contains("HandshakeFailure") {
|
||||||
state.increase_net_attacks();
|
state.increase_net_attacks();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
conn.unwrap()
|
conn.unwrap()
|
||||||
|
Loading…
Reference in New Issue
Block a user