@@ -111,45 +111,89 @@ impl TcpKeepaliveConfig {
111
111
}
112
112
}
113
113
114
- #[ cfg( not( any(
115
- target_os = "aix" ,
116
- target_os = "openbsd" ,
117
- target_os = "redox" ,
118
- target_os = "solaris"
119
- ) ) ) ]
114
+ #[ cfg(
115
+ // See https://docs.rs/socket2/0.5.8/src/socket2/lib.rs.html#511-525
116
+ any(
117
+ target_os = "android" ,
118
+ target_os = "dragonfly" ,
119
+ target_os = "freebsd" ,
120
+ target_os = "fuchsia" ,
121
+ target_os = "illumos" ,
122
+ target_os = "ios" ,
123
+ target_os = "visionos" ,
124
+ target_os = "linux" ,
125
+ target_os = "macos" ,
126
+ target_os = "netbsd" ,
127
+ target_os = "tvos" ,
128
+ target_os = "watchos" ,
129
+ target_os = "windows" ,
130
+ )
131
+ ) ]
120
132
fn ka_with_interval ( ka : TcpKeepalive , interval : Duration , dirty : & mut bool ) -> TcpKeepalive {
121
133
* dirty = true ;
122
134
ka. with_interval ( interval)
123
135
}
124
136
125
- #[ cfg( any(
126
- target_os = "aix" ,
127
- target_os = "openbsd" ,
128
- target_os = "redox" ,
129
- target_os = "solaris"
137
+ #[ cfg( not(
138
+ // See https://docs.rs/socket2/0.5.8/src/socket2/lib.rs.html#511-525
139
+ any(
140
+ target_os = "android" ,
141
+ target_os = "dragonfly" ,
142
+ target_os = "freebsd" ,
143
+ target_os = "fuchsia" ,
144
+ target_os = "illumos" ,
145
+ target_os = "ios" ,
146
+ target_os = "visionos" ,
147
+ target_os = "linux" ,
148
+ target_os = "macos" ,
149
+ target_os = "netbsd" ,
150
+ target_os = "tvos" ,
151
+ target_os = "watchos" ,
152
+ target_os = "windows" ,
153
+ )
130
154
) ) ]
131
155
fn ka_with_interval ( ka : TcpKeepalive , _: Duration , _: & mut bool ) -> TcpKeepalive {
132
156
ka // no-op as keepalive interval is not supported on this platform
133
157
}
134
158
135
- #[ cfg( not( any(
136
- target_os = "aix" ,
137
- target_os = "openbsd" ,
138
- target_os = "redox" ,
139
- target_os = "solaris" ,
140
- target_os = "windows"
141
- ) ) ) ]
159
+ #[ cfg(
160
+ // See https://docs.rs/socket2/0.5.8/src/socket2/lib.rs.html#557-570
161
+ any(
162
+ target_os = "android" ,
163
+ target_os = "dragonfly" ,
164
+ target_os = "freebsd" ,
165
+ target_os = "fuchsia" ,
166
+ target_os = "illumos" ,
167
+ target_os = "ios" ,
168
+ target_os = "visionos" ,
169
+ target_os = "linux" ,
170
+ target_os = "macos" ,
171
+ target_os = "netbsd" ,
172
+ target_os = "tvos" ,
173
+ target_os = "watchos" ,
174
+ )
175
+ ) ]
142
176
fn ka_with_retries ( ka : TcpKeepalive , retries : u32 , dirty : & mut bool ) -> TcpKeepalive {
143
177
* dirty = true ;
144
178
ka. with_retries ( retries)
145
179
}
146
180
147
- #[ cfg( any(
148
- target_os = "aix" ,
149
- target_os = "openbsd" ,
150
- target_os = "redox" ,
151
- target_os = "solaris" ,
152
- target_os = "windows"
181
+ #[ cfg( not(
182
+ // See https://docs.rs/socket2/0.5.8/src/socket2/lib.rs.html#557-570
183
+ any(
184
+ target_os = "android" ,
185
+ target_os = "dragonfly" ,
186
+ target_os = "freebsd" ,
187
+ target_os = "fuchsia" ,
188
+ target_os = "illumos" ,
189
+ target_os = "ios" ,
190
+ target_os = "visionos" ,
191
+ target_os = "linux" ,
192
+ target_os = "macos" ,
193
+ target_os = "netbsd" ,
194
+ target_os = "tvos" ,
195
+ target_os = "watchos" ,
196
+ )
153
197
) ) ]
154
198
fn ka_with_retries ( ka : TcpKeepalive , _: u32 , _: & mut bool ) -> TcpKeepalive {
155
199
ka // no-op as keepalive retries is not supported on this platform
0 commit comments