@@ -43,24 +43,62 @@ impl TcpKeepaliveConfig {
43
43
}
44
44
}
45
45
46
- #[ cfg( not( any( target_os = "openbsd" , target_os = "redox" , target_os = "solaris" ) ) ) ]
46
+ #[ cfg( any(
47
+ target_os = "android" ,
48
+ target_os = "dragonfly" ,
49
+ target_os = "freebsd" ,
50
+ target_os = "fuchsia" ,
51
+ target_os = "illumos" ,
52
+ target_os = "linux" ,
53
+ target_os = "netbsd" ,
54
+ target_vendor = "apple" ,
55
+ windows,
56
+ ) ) ]
47
57
fn ka_with_interval ( ka : TcpKeepalive , interval : Duration , dirty : & mut bool ) -> TcpKeepalive {
48
58
* dirty = true ;
49
59
ka. with_interval ( interval)
50
60
}
51
61
52
- #[ cfg( any( target_os = "openbsd" , target_os = "redox" , target_os = "solaris" ) ) ]
62
+ #[ cfg( not( any(
63
+ target_os = "android" ,
64
+ target_os = "dragonfly" ,
65
+ target_os = "freebsd" ,
66
+ target_os = "fuchsia" ,
67
+ target_os = "illumos" ,
68
+ target_os = "linux" ,
69
+ target_os = "netbsd" ,
70
+ target_vendor = "apple" ,
71
+ windows,
72
+ ) ) ) ]
53
73
fn ka_with_interval ( ka : TcpKeepalive , _: Duration , _: & mut bool ) -> TcpKeepalive {
54
74
ka // no-op as keepalive interval is not supported on this platform
55
75
}
56
76
57
- #[ cfg( not( any( target_os = "openbsd" , target_os = "redox" , target_os = "solaris" , target_os = "windows" ) ) ) ]
77
+ #[ cfg( any(
78
+ target_os = "android" ,
79
+ target_os = "dragonfly" ,
80
+ target_os = "freebsd" ,
81
+ target_os = "fuchsia" ,
82
+ target_os = "illumos" ,
83
+ target_os = "linux" ,
84
+ target_os = "netbsd" ,
85
+ target_vendor = "apple" ,
86
+ ) ) ]
58
87
fn ka_with_retries ( ka : TcpKeepalive , retries : u32 , dirty : & mut bool ) -> TcpKeepalive {
59
88
* dirty = true ;
60
89
ka. with_retries ( retries)
61
90
}
62
91
63
- #[ cfg( any( target_os = "openbsd" , target_os = "redox" , target_os = "solaris" , target_os = "windows" ) ) ]
92
+ #[ cfg( not( any(
93
+ target_os = "android" ,
94
+ target_os = "dragonfly" ,
95
+ target_os = "freebsd" ,
96
+ target_os = "fuchsia" ,
97
+ target_os = "illumos" ,
98
+ target_os = "linux" ,
99
+ target_os = "netbsd" ,
100
+ target_vendor = "apple" ,
101
+ ) ) ) ]
64
102
fn ka_with_retries ( ka : TcpKeepalive , _: u32 , _: & mut bool ) -> TcpKeepalive {
65
103
ka // no-op as keepalive retries is not supported on this platform
66
104
}
@@ -401,7 +439,17 @@ mod tests {
401
439
}
402
440
}
403
441
404
- #[ cfg( not( any( target_os = "openbsd" , target_os = "redox" , target_os = "solaris" ) ) ) ]
442
+ #[ cfg( any(
443
+ target_os = "android" ,
444
+ target_os = "dragonfly" ,
445
+ target_os = "freebsd" ,
446
+ target_os = "fuchsia" ,
447
+ target_os = "illumos" ,
448
+ target_os = "linux" ,
449
+ target_os = "netbsd" ,
450
+ target_vendor = "apple" ,
451
+ windows,
452
+ ) ) ]
405
453
#[ test]
406
454
fn tcp_keepalive_interval_config ( ) {
407
455
let mut kac = TcpKeepaliveConfig :: default ( ) ;
@@ -413,7 +461,16 @@ mod tests {
413
461
}
414
462
}
415
463
416
- #[ cfg( not( any( target_os = "openbsd" , target_os = "redox" , target_os = "solaris" , target_os = "windows" ) ) ) ]
464
+ #[ cfg( any(
465
+ target_os = "android" ,
466
+ target_os = "dragonfly" ,
467
+ target_os = "freebsd" ,
468
+ target_os = "fuchsia" ,
469
+ target_os = "illumos" ,
470
+ target_os = "linux" ,
471
+ target_os = "netbsd" ,
472
+ target_vendor = "apple" ,
473
+ ) ) ]
417
474
#[ test]
418
475
fn tcp_keepalive_retries_config ( ) {
419
476
let mut kac = TcpKeepaliveConfig :: default ( ) ;
0 commit comments