File tree 1 file changed +9
-12
lines changed
1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ pub struct EncryptedDnsProxyState {
13
13
/// Note that we rely on the randomness of the ordering of the items in the hashset to pick a
14
14
/// random configurations every time.
15
15
configurations : HashSet < ProxyConfig > ,
16
- has_tried_xor : bool ,
17
16
tried_configurations : HashSet < ProxyConfig > ,
18
17
}
19
18
@@ -94,17 +93,15 @@ impl EncryptedDnsProxyState {
94
93
}
95
94
96
95
fn next_configuration ( & mut self ) -> Option < ProxyConfig > {
97
- if !self . has_tried_xor {
98
- self . has_tried_xor = true ;
99
- if let Some ( xor_config) = self
100
- . configurations
101
- . iter ( )
102
- // prefer obfuscated proxy configurations.
103
- . find ( |config| config. obfuscation . is_some ( ) )
104
- {
105
- self . tried_configurations . insert ( xor_config. clone ( ) ) ;
106
- return Some ( xor_config. clone ( ) ) ;
107
- }
96
+ if let Some ( xor_config) = self
97
+ . configurations
98
+ . diference ( & self . tried_configurations )
99
+ // prefer obfuscated proxy configurations.
100
+ . find ( |config| config. obfuscation . is_some ( ) )
101
+ . cloned ( )
102
+ {
103
+ self . tried_configurations . insert ( xor_config. clone ( ) ) ;
104
+ return Some ( xor_config) ;
108
105
}
109
106
110
107
let config = self
You can’t perform that action at this time.
0 commit comments