mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-23 19:48:19 +00:00
Tweak naming/docs/signature
This commit is contained in:
committed by
Dirkjan Ochtman
parent
7436eb2d1b
commit
af1effdedb
@@ -371,7 +371,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
if self.path.anti_amplification_blocked(self.mtu) {
|
||||
if self.path.anti_amplification_blocked(self.mtu.into()) {
|
||||
trace!("blocked by anti-amplification");
|
||||
return None;
|
||||
}
|
||||
@@ -1481,7 +1481,7 @@ where
|
||||
return;
|
||||
}
|
||||
|
||||
if self.path.anti_amplification_blocked(self.mtu) {
|
||||
if self.path.anti_amplification_blocked(self.mtu.into()) {
|
||||
// We wouldn't be able to send anything, so don't bother.
|
||||
self.timers.stop(Timer::LossDetection);
|
||||
return;
|
||||
|
||||
@@ -65,9 +65,9 @@ impl PathData {
|
||||
}
|
||||
|
||||
/// Indicates whether we're a server that hasn't validated the peer's address and hasn't
|
||||
/// received enough data from the peer to permit additional sending
|
||||
pub fn anti_amplification_blocked(&self, mtu: u16) -> bool {
|
||||
!self.validated && self.total_recvd * 3 < self.total_sent + u64::from(mtu)
|
||||
/// received enough data from the peer to permit sending `bytes_to_send` additional bytes
|
||||
pub fn anti_amplification_blocked(&self, bytes_to_send: u64) -> bool {
|
||||
!self.validated && self.total_recvd * 3 < self.total_sent + bytes_to_send
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user