@@ -13,12 +13,16 @@ use thiserror::Error;
13
13
14
14
#[ cfg( any( feature = "rustls-aws-lc-rs" , feature = "rustls-ring" ) ) ]
15
15
use crate :: crypto:: rustls:: { configured_provider, QuicServerConfig } ;
16
+ #[ cfg( feature = "fastbloom" ) ]
17
+ use crate :: BloomTokenLog ;
18
+ #[ cfg( not( feature = "fastbloom" ) ) ]
19
+ use crate :: NoneTokenLog ;
16
20
use crate :: {
17
21
cid_generator:: { ConnectionIdGenerator , HashedConnectionIdGenerator } ,
18
22
crypto:: { self , HandshakeTokenKey , HmacKey } ,
19
23
shared:: ConnectionId ,
20
- Duration , NoneTokenLog , NoneTokenStore , RandomConnectionIdGenerator , SystemTime , TokenLog ,
21
- TokenStore , VarInt , VarIntBoundsExceeded , DEFAULT_SUPPORTED_VERSIONS , MAX_CID_SIZE ,
24
+ Duration , NoneTokenStore , RandomConnectionIdGenerator , SystemTime , TokenLog , TokenStore ,
25
+ VarInt , VarIntBoundsExceeded , DEFAULT_SUPPORTED_VERSIONS , MAX_CID_SIZE ,
22
26
} ;
23
27
24
28
mod transport;
@@ -487,8 +491,12 @@ impl ValidationTokenConfig {
487
491
488
492
/// Set a custom [`TokenLog`]
489
493
///
490
- /// Defaults to [`NoneTokenLog`], which makes the server ignore all address validation tokens
491
- /// (that is, tokens originating from NEW_TOKEN frames--retry tokens are not affected).
494
+ /// If the `fastbloom` feature is enabled (which it is by default), defaults to a default
495
+ /// [`BloomTokenLog`], which is suitable for most internet applications.
496
+ ///
497
+ /// If the `fastbloom` feature is disabled, defaults to [`NoneTokenLog`], which makes the
498
+ /// server ignore all address validation tokens (that is, tokens originating from NEW_TOKEN
499
+ /// frames--retry tokens are not affected).
492
500
pub fn log ( & mut self , log : Arc < dyn TokenLog > ) -> & mut Self {
493
501
self . log = log;
494
502
self
@@ -507,9 +515,13 @@ impl ValidationTokenConfig {
507
515
508
516
impl Default for ValidationTokenConfig {
509
517
fn default ( ) -> Self {
518
+ #[ cfg( feature = "fastbloom" ) ]
519
+ let log = Arc :: new ( BloomTokenLog :: default ( ) ) ;
520
+ #[ cfg( not( feature = "fastbloom" ) ) ]
521
+ let log = Arc :: new ( NoneTokenLog ) ;
510
522
Self {
511
523
lifetime : Duration :: from_secs ( 2 * 7 * 24 * 60 * 60 ) ,
512
- log : Arc :: new ( NoneTokenLog ) ,
524
+ log,
513
525
sent : 0 ,
514
526
}
515
527
}
0 commit comments