Tweak naming/docs/signature

This commit is contained in:
Benjamin Saunders
2021-01-04 18:41:19 -08:00
committed by Dirkjan Ochtman
parent 7436eb2d1b
commit af1effdedb
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -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;
+3 -3
View File
@@ -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
}
}