File tree 2 files changed +12
-7
lines changed
2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -503,8 +503,14 @@ impl TunnelParams {
503
503
Ok ( ( ) )
504
504
}
505
505
506
+ pub fn default_config_dir ( ) -> PathBuf {
507
+ ProjectDirs :: from ( "" , "" , "snx-rs" )
508
+ . expect ( "No home directory!" )
509
+ . config_dir ( )
510
+ . to_owned ( )
511
+ }
512
+
506
513
pub fn default_config_path ( ) -> PathBuf {
507
- let dir = ProjectDirs :: from ( "" , "" , "snx-rs" ) . expect ( "No home directory!" ) ;
508
- dir. config_dir ( ) . join ( "snx-rs.conf" )
514
+ Self :: default_config_dir ( ) . join ( "snx-rs.conf" )
509
515
}
510
516
}
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ impl NattProber {
55
55
if self . send_probe ( ) . await . is_err ( ) {
56
56
// attempt to unblock port 4500 by sending some magic packets to port 500
57
57
self . send_nmap_knock ( ) . await ?;
58
+ self . send_nmap_knock ( ) . await ?;
58
59
59
60
for _ in 0 ..MAX_NATT_PROBES {
60
61
if self . send_probe ( ) . await . is_ok ( ) {
@@ -100,12 +101,10 @@ impl NattProber {
100
101
let udp = UdpSocket :: bind ( "0.0.0.0:0" ) . await ?;
101
102
udp. connect ( format ! ( "{}:500" , self . address) ) . await ?;
102
103
103
- for _ in 0 ..2 {
104
- for probe in NMAP_KNOCK {
105
- let _ = udp. send ( probe) . await ;
106
- }
107
- tokio:: time:: sleep ( Duration :: from_millis ( 100 ) ) . await ;
104
+ for probe in NMAP_KNOCK {
105
+ let _ = udp. send ( probe) . await ;
108
106
}
107
+ tokio:: time:: sleep ( Duration :: from_millis ( 100 ) ) . await ;
109
108
110
109
Ok ( ( ) )
111
110
}
You can’t perform that action at this time.
0 commit comments