Compare commits
2 Commits
ad9c445fe5
...
3be12f7807
Author | SHA1 | Date | |
---|---|---|---|
3be12f7807 | |||
e86ee534ed |
@ -93,7 +93,10 @@ impl NodeServer {
|
|||||||
|
|
||||||
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") {
|
let attack_error_messages = ["handshake", "certificate", "quote"];
|
||||||
|
|
||||||
|
let err_str = e.to_string().to_lowercase();
|
||||||
|
if attack_error_messages.iter().any(|att_er_str| err_str.contains(att_er_str)) {
|
||||||
state.increase_net_attacks().await;
|
state.increase_net_attacks().await;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -197,6 +200,7 @@ impl Update for NodeServer {
|
|||||||
yield Ok(update.update);
|
yield Ok(update.update);
|
||||||
}
|
}
|
||||||
// TODO: check if disconnect client if too many connections are active
|
// TODO: check if disconnect client if too many connections are active
|
||||||
|
// Its tested and working
|
||||||
if tx.receiver_count() > 9 {
|
if tx.receiver_count() > 9 {
|
||||||
error_status = Status::internal("Already have too many clients. Connect to another server.");
|
error_status = Status::internal("Already have too many clients. Connect to another server.");
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user