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 response = client.get_updates(rx_stream).await.map_err(|e| { | ||||
|             println!("Error connecting to {node_ip}: {e}"); | ||||
|             self.state.increase_net_attacks(); | ||||
|             if e.to_string().contains("QuoteVerifyError") { | ||||
|                 self.state.increase_net_attacks(); | ||||
|             } | ||||
|             e | ||||
|         })?; | ||||
|         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| { | ||||
|         println!("Error getting keys from {node_ip}: {e}"); | ||||
|         state.increase_net_attacks(); | ||||
|         if e.to_string().contains("QuoteVerifyError") { | ||||
|             state.increase_net_attacks(); | ||||
|         } | ||||
|         e | ||||
|     })?; | ||||
|     Ok(response.into_inner()) | ||||
|  | ||||
| @ -55,7 +55,6 @@ impl MyServer { | ||||
|                 Ok(incoming) => incoming, | ||||
|                 Err(e) => { | ||||
|                     println!("Error accepting connection: {}", e); | ||||
|                     state.increase_net_attacks(); | ||||
|                     continue; | ||||
|                 } | ||||
|             }; | ||||
| @ -79,8 +78,10 @@ impl MyServer { | ||||
|                     .await; | ||||
| 
 | ||||
|                 let conn = if let Err(e) = conn { | ||||
|                     println!("Error accepting TLS connection: {}", e); | ||||
|                     state.increase_net_attacks(); | ||||
|                     println!("Error accepting TLS connection: {e}"); | ||||
|                     if e.to_string().contains("HandshakeFailure") { | ||||
|                         state.increase_net_attacks(); | ||||
|                     } | ||||
|                     return; | ||||
|                 } else { | ||||
|                     conn.unwrap() | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user