Skip to content

Commit

Permalink
Set default tokens sent to 2 if fastbloom enabled
Browse files Browse the repository at this point in the history
It makes sense to do this now that we have a default token log that's
actually able to accept tokens.
  • Loading branch information
gretchenfrage committed Jan 26, 2025
1 parent 5c4d19b commit 3e0687d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions quinn-proto/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@ impl ValidationTokenConfig {
///
/// This refers only to tokens sent in NEW_TOKEN frames, in contrast to retry tokens.
///
/// Defaults to 0.
/// If the `fastbloom` feature is enabled (which it is by default), defaults to 2. Otherwise,
/// defaults to 0.
pub fn sent(&mut self, value: u32) -> &mut Self {
self.sent = value;
self
Expand All @@ -522,7 +523,7 @@ impl Default for ValidationTokenConfig {
Self {
lifetime: Duration::from_secs(2 * 7 * 24 * 60 * 60),
log,
sent: 0,
sent: if cfg!(feature = "fastbloom") { 2 } else { 0 },
}
}
}
Expand Down

0 comments on commit 3e0687d

Please sign in to comment.