@@ -232,7 +232,7 @@ pub struct AccessModeSelector<B: AccessMethodResolver> {
232
232
#[ cfg( feature = "api-override" ) ]
233
233
api_endpoint : ApiEndpoint ,
234
234
cmd_rx : mpsc:: UnboundedReceiver < Message > ,
235
- bridge_dns_proxy_provider : B ,
235
+ method_resolver : B ,
236
236
access_method_settings : Settings ,
237
237
access_method_event_sender : mpsc:: UnboundedSender < ( AccessMethodEvent , oneshot:: Sender < ( ) > ) > ,
238
238
connection_mode_provider_sender : mpsc:: UnboundedSender < ApiConnectionMode > ,
@@ -243,7 +243,7 @@ pub struct AccessModeSelector<B: AccessMethodResolver> {
243
243
244
244
impl < B : AccessMethodResolver + ' static > AccessModeSelector < B > {
245
245
pub async fn spawn (
246
- mut bridge_dns_proxy_provider : B ,
246
+ mut method_resolver : B ,
247
247
#[ cfg_attr( not( feature = "api-override" ) , allow( unused_mut) ) ]
248
248
mut access_method_settings : Settings ,
249
249
#[ cfg( feature = "api-override" ) ] api_endpoint : ApiEndpoint ,
@@ -261,8 +261,7 @@ impl<B: AccessMethodResolver + 'static> AccessModeSelector<B> {
261
261
262
262
// Always start looking from the position of `Direct`.
263
263
let ( index, next) = Self :: find_next_active ( 0 , & access_method_settings) ;
264
- let initial_connection_mode =
265
- Self :: resolve_with_default ( & next, & mut bridge_dns_proxy_provider) . await ;
264
+ let initial_connection_mode = Self :: resolve_with_default ( & next, & mut method_resolver) . await ;
266
265
267
266
let ( change_tx, change_rx) = mpsc:: unbounded ( ) ;
268
267
@@ -272,7 +271,7 @@ impl<B: AccessMethodResolver + 'static> AccessModeSelector<B> {
272
271
#[ cfg( feature = "api-override" ) ]
273
272
api_endpoint,
274
273
cmd_rx,
275
- bridge_dns_proxy_provider ,
274
+ method_resolver ,
276
275
access_method_settings,
277
276
access_method_event_sender,
278
277
connection_mode_provider_sender : change_tx,
@@ -379,8 +378,7 @@ impl<B: AccessMethodResolver + 'static> AccessModeSelector<B> {
379
378
}
380
379
381
380
async fn set_current ( & mut self , access_method : AccessMethodSetting ) {
382
- let resolved =
383
- Self :: resolve_with_default ( & access_method, & mut self . bridge_dns_proxy_provider ) . await ;
381
+ let resolved = Self :: resolve_with_default ( & access_method, & mut self . method_resolver ) . await ;
384
382
385
383
// Note: If the daemon is busy waiting for a call to this function
386
384
// to complete while we wait for the daemon to fully handle this
@@ -490,7 +488,7 @@ impl<B: AccessMethodResolver + 'static> AccessModeSelector<B> {
490
488
method_setting : AccessMethodSetting ,
491
489
) -> Option < ResolvedConnectionMode > {
492
490
let ( endpoint, connection_mode) = self
493
- . bridge_dns_proxy_provider
491
+ . method_resolver
494
492
. resolve_access_method_setting ( & method_setting. access_method )
495
493
. await ?;
496
494
Some ( ResolvedConnectionMode {
@@ -504,15 +502,15 @@ impl<B: AccessMethodResolver + 'static> AccessModeSelector<B> {
504
502
/// [`ApiConnectionMode::Direct`] in case `access_method` does not yield anything.
505
503
async fn resolve_with_default (
506
504
method_setting : & AccessMethodSetting ,
507
- bridge_dns_proxy_provider : & mut B ,
505
+ method_resolver : & mut B ,
508
506
) -> ResolvedConnectionMode {
509
- let ( endpoint, connection_mode) = match bridge_dns_proxy_provider
507
+ let ( endpoint, connection_mode) = match method_resolver
510
508
. resolve_access_method_setting ( & method_setting. access_method )
511
509
. await
512
510
{
513
511
Some ( resolved) => resolved,
514
512
None => (
515
- bridge_dns_proxy_provider . default_connection_mode ( ) . await ,
513
+ method_resolver . default_connection_mode ( ) . await ,
516
514
ApiConnectionMode :: Direct ,
517
515
) ,
518
516
} ;
0 commit comments