File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,38 +5,38 @@ edition = "2021"
55
66[dependencies ]
77arc-swap = " 1.7.1"
8- async-trait = " 0.1.83 "
8+ async-trait = " 0.1.42 "
99base64 = " 0.22.1"
10- bytes = " 1.8. 0"
11- dashmap = " 6.1.0 "
10+ bytes = " 1.0"
11+ dashmap = " 5 "
1212env_logger = { version = " 0.11.5" , features = [" unstable-kv" ] }
13- etcd-client = " 0.16.1 "
14- futures = " 0.3.31 "
15- hex = " 0.4.3 "
13+ etcd-client = " 0.18.0 "
14+ futures = " 0.3"
15+ hex = " 0.4"
1616hickory-resolver = " 0.25.2"
17- http = " 1.1.0 "
17+ http = " 1"
1818ipnetwork = { version = " 0.21.1" , features = [" serde" ] }
1919jsonwebtoken = " 9.3.1"
20- log = { version = " 0.4.22 " , features = [" kv" ] }
20+ log = { version = " 0.4" , features = [" kv" ] }
2121matchit = " 0.8.4"
22- once_cell = " 1.20.2 "
23- pingora = { version = " 0.6 .0" , features = [" openssl" , " sentry" ] }
24- pingora-cache = " 0.6 .0"
25- pingora-core = " 0.6 .0"
26- pingora-error = " 0.6 .0"
27- pingora-http = " 0.6 .0"
28- pingora-limits = " 0.6 .0"
29- pingora-load-balancing = " 0.6 .0"
30- pingora-proxy = " 0.6 .0"
31- pingora-runtime = " 0.6 .0"
32- prometheus = " 0.13.4 "
33- rand = " 0.9.2 "
22+ once_cell = " 1"
23+ pingora = { version = " 0.7 .0" , features = [" openssl" , " sentry" ] }
24+ pingora-cache = " 0.7 .0"
25+ pingora-core = " 0.7 .0"
26+ pingora-error = " 0.7 .0"
27+ pingora-http = " 0.7 .0"
28+ pingora-limits = " 0.7 .0"
29+ pingora-load-balancing = " 0.7 .0"
30+ pingora-proxy = " 0.7 .0"
31+ pingora-runtime = " 0.7 .0"
32+ prometheus = " 0.13"
33+ rand = " 0.8 "
3434regex = " 1.11.1"
3535sentry = " 0.36"
36- serde = { version = " 1.0.197 " , features = [" derive" ] }
37- serde_json = " 1.0.133 "
36+ serde = { version = " 1.0" , features = [" derive" ] }
37+ serde_json = " 1.0"
3838serde_with = " 3.12.0"
39- serde_yaml = " 0.9.34 "
39+ serde_yaml = " 0.9"
4040sha2 = " 0.10.9"
4141tokio = { version = " 1.41.1" , features = [" fs" ] }
4242uuid = { version = " 1.16.0" , features = [" v4" ] }
Original file line number Diff line number Diff line change @@ -85,18 +85,13 @@ impl EtcdConfigSync {
8585
8686 let client = self . get_client ( ) . await ?;
8787
88- let ( mut watcher , mut stream) = client
88+ let mut stream = client
8989 . watch ( prefix. as_str ( ) , Some ( options) )
9090 . await
9191 . map_err ( |e| {
9292 ProxyError :: etcd_error_with_cause ( format ! ( "Failed to watch key '{prefix}'" ) , e)
9393 } ) ?;
9494
95- watcher
96- . request_progress ( )
97- . await
98- . map_err ( |e| ProxyError :: etcd_error_with_cause ( "Failed to request progress" , e) ) ?;
99-
10095 while let Some ( response) = stream
10196 . message ( )
10297 . await
Original file line number Diff line number Diff line change @@ -87,9 +87,9 @@ impl PluginCsrf {
8787 ///
8888 /// Returns None if system time is unavailable (should never happen in practice)
8989 fn gen_token_string ( & self ) -> Option < String > {
90- let mut rng = rand:: rng ( ) ;
90+ let mut rng = rand:: thread_rng ( ) ;
9191 // Generate 16 random bytes for better entropy than f64
92- let random_bytes: [ u8 ; 16 ] = rng. random ( ) ;
92+ let random_bytes: [ u8 ; 16 ] = rng. gen ( ) ;
9393 let random = hex:: encode ( random_bytes) ;
9494
9595 // Get current timestamp, handle potential system time errors gracefully
Original file line number Diff line number Diff line change @@ -103,8 +103,8 @@ impl PluginFaultInjection {
103103 match percentage {
104104 None => true , // If no percentage is set, always apply
105105 Some ( pct) => {
106- let mut rng = rand:: rng ( ) ;
107- rng. random_range ( 1 ..=100 ) <= pct
106+ let mut rng = rand:: thread_rng ( ) ;
107+ rng. gen_range ( 1 ..=100 ) <= pct
108108 }
109109 }
110110 }
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ impl PluginRequestID {
131131 return Uuid :: new_v4 ( ) . to_string ( ) ;
132132 }
133133
134- let mut rng = rand:: rng ( ) ;
134+ let mut rng = rand:: thread_rng ( ) ;
135135 ( 0 ..self . config . range_id . length )
136136 . map ( |_| {
137137 chars
Original file line number Diff line number Diff line change 11use async_trait:: async_trait;
22use pingora_error:: Result ;
33use pingora_proxy:: Session ;
4+ use rand:: Rng ;
45use serde:: { Deserialize , Serialize } ;
56use serde_json:: Value as JsonValue ;
67use std:: sync:: Arc ;
@@ -115,7 +116,8 @@ impl PluginTrafficSplit {
115116 return None ;
116117 }
117118
118- let mut n = rand:: random_range ( 0 ..total_weight) ;
119+ let mut rng = rand:: thread_rng ( ) ;
120+ let mut n = rng. gen_range ( 0 ..total_weight) ;
119121
120122 for ( i, ups_cfg) in upstreams. iter ( ) . enumerate ( ) {
121123 if n < ups_cfg. weight {
You can’t perform that action at this time.
0 commit comments