docs: Correct protocol retransmission unit/vars

Those are seconds not ms, also it's BEGIN not BEG.

While over there, drop the unused variable `RETRANSMIT_ABORT` which was
never used anywhere in the code and drop an outdated TODO comment.

Signed-off-by: Paul Spooren <mail@aparcar.org>
This commit is contained in:
Paul Spooren
2024-09-17 13:51:52 +02:00
parent b0706354d3
commit 687ef3f6f8

View File

@@ -134,11 +134,10 @@ pub const PEER_COOKIE_VALUE_EPOCH: Timing = 120.0;
// decryption for a second epoch
pub const BISCUIT_EPOCH: Timing = 300.0;
// Retransmission pub constants; will retransmit for up to _ABORT ms; starting with a delay of
// _DELAY_BEG ms and increasing the delay exponentially by a factor of
// _DELAY_GROWTH up to _DELAY_END. An additional jitter factor of ±_DELAY_JITTER
// is added.
pub const RETRANSMIT_ABORT: Timing = 120.0;
// Retransmission pub constants; will retransmit for up to _ABORT seconds;
// starting with a delay of _DELAY_BEGIN seconds and increasing the delay
// exponentially by a factor of _DELAY_GROWTH up to _DELAY_END.
// An additional jitter factor of ±_DELAY_JITTER is added.
pub const RETRANSMIT_DELAY_GROWTH: Timing = 2.0;
pub const RETRANSMIT_DELAY_BEGIN: Timing = 0.5;
pub const RETRANSMIT_DELAY_END: Timing = 10.0;
@@ -1473,7 +1472,7 @@ impl IniHsPtr {
.min(ih.tx_count as f64),
)
* RETRANSMIT_DELAY_JITTER
* (rand::random::<f64>() + 1.0); // TODO: Replace with the rand crate
* (rand::random::<f64>() + 1.0);
ih.tx_count += 1;
Ok(())
}