Skip to content

Commit f4c57a8

Browse files
committed
Remove original_dst from all feature
Signed-off-by: Keith Mattix II <[email protected]>
1 parent 2cd3915 commit f4c57a8

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

src/socket.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
8-
98
use std::fmt;
109
use std::io::{self, Read, Write};
1110
#[cfg(not(target_os = "redox"))]
@@ -18,11 +17,11 @@ use std::net::{self, Ipv4Addr, Shutdown};
1817
use std::os::unix::io::{FromRawFd, IntoRawFd};
1918
#[cfg(windows)]
2019
use std::os::windows::io::{FromRawSocket, IntoRawSocket};
20+
use std::time::Duration;
2121
#[cfg(windows)]
2222
use windows_sys::Win32::Networking::WinSock::{
23-
IP6T_SO_ORIGINAL_DST, SOL_IP, SO_ORIGINAL_DST, SOCKET_ERROR
23+
IP6T_SO_ORIGINAL_DST, SOCKET_ERROR, SOL_IP, SO_ORIGINAL_DST,
2424
};
25-
use std::time::Duration;
2625

2726
use crate::sys::{self, c_int, getsockopt, setsockopt, Bool};
2827
#[cfg(all(unix, not(target_os = "redox")))]
@@ -31,8 +30,8 @@ use crate::{Domain, Protocol, SockAddr, TcpKeepalive, Type};
3130
#[cfg(not(target_os = "redox"))]
3231
use crate::{MaybeUninitSlice, MsgHdr, RecvFlags};
3332

34-
#[cfg(all(feature = "all", windows))]
35-
#[cfg_attr(docsrs, doc(cfg(all(windows, feature = "all"))))]
33+
#[cfg(windows)]
34+
#[cfg_attr(docsrs, doc(cfg(windows)))]
3635
/// Helper macro to execute a system call that returns an `io::Result`.
3736
macro_rules! syscall {
3837
($fn: ident ( $($arg: expr),* $(,)* ), $err_test: path, $err_value: expr) => {{
@@ -49,16 +48,17 @@ macro_rules! syscall {
4948
#[cfg(all(
5049
feature = "all",
5150
any(
52-
target_os = "android",
53-
target_os = "dragonfly",
54-
target_os = "freebsd",
55-
target_os = "fuchsia",
56-
target_os = "hurd",
57-
target_os = "illumos",
58-
target_os = "linux",
59-
target_os = "netbsd",
60-
target_os = "openbsd",
61-
)))]
51+
target_os = "android",
52+
target_os = "dragonfly",
53+
target_os = "freebsd",
54+
target_os = "fuchsia",
55+
target_os = "hurd",
56+
target_os = "illumos",
57+
target_os = "linux",
58+
target_os = "netbsd",
59+
target_os = "openbsd",
60+
)
61+
))]
6262
/// Helper macro to execute a system call that returns an `io::Result`.
6363
macro_rules! syscall {
6464
($fn: ident ( $($arg: expr),* $(,)* ) ) => {{
@@ -2307,16 +2307,16 @@ impl Socket {
23072307
.map(|(_, addr)| addr)
23082308
}
23092309

2310-
/// Get the value for the `SO_ORIGINAL_DST` option on this socket.
2310+
/// Get the value for the `SO_ORIGINAL_DST` option on this socket.
23112311
/// Only valid for sockets in accepting mode.
23122312
///
23132313
/// Note: if using this function in a proxy context, you must query the
23142314
/// redirect records for this socket and set them on the outbound socket
23152315
/// created by your proxy in order for any OS level firewall rules to be
23162316
/// applied. Read more in the Windows bind and connect redirection
23172317
/// [documentation](https://learn.microsoft.com/en-us/windows-hardware/drivers/network/using-bind-or-connect-redirection).
2318-
#[cfg(all(feature = "all", target_os = "windows"))]
2319-
#[cfg_attr(docsrs, doc(cfg(all(windows, feature = "all"))))]
2318+
#[cfg(windows)]
2319+
#[cfg_attr(docsrs, doc(cfg(windows)))]
23202320
pub fn original_dst(&self) -> io::Result<SockAddr> {
23212321
unsafe {
23222322
SockAddr::try_init(|storage, len| {
@@ -2344,8 +2344,8 @@ impl Socket {
23442344
/// created by your proxy in order for any OS level firewall rules to be
23452345
/// applied. Read more in the Windows bind and connect redirection
23462346
/// [documentation](https://learn.microsoft.com/en-us/windows-hardware/drivers/network/using-bind-or-connect-redirection).
2347-
#[cfg(all(feature = "all", target_os = "windows"))]
2348-
#[cfg_attr(docsrs, doc(cfg(all(windows, feature = "all"))))]
2347+
#[cfg(windows)]
2348+
#[cfg_attr(docsrs, doc(cfg(windows)))]
23492349
pub fn original_dst_ipv6(&self) -> io::Result<SockAddr> {
23502350
unsafe {
23512351
SockAddr::try_init(|storage, len| {

src/sys/windows.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ use std::time::{Duration, Instant};
2020
use std::{process, ptr, slice};
2121

2222
use windows_sys::Win32::Foundation::{SetHandleInformation, HANDLE, HANDLE_FLAG_INHERIT};
23+
#[cfg(feature = "all")]
24+
use windows_sys::Win32::Networking::WinSock::SO_PROTOCOL_INFOW;
2325
use windows_sys::Win32::Networking::WinSock::{
2426
self, tcp_keepalive, FIONBIO, IN6_ADDR, IN6_ADDR_0, INVALID_SOCKET, IN_ADDR, IN_ADDR_0,
2527
POLLERR, POLLHUP, POLLRDNORM, POLLWRNORM, SD_BOTH, SD_RECEIVE, SD_SEND, SIO_KEEPALIVE_VALS,
2628
SOCKET_ERROR, WSABUF, WSAEMSGSIZE, WSAESHUTDOWN, WSAPOLLFD, WSAPROTOCOL_INFOW,
2729
WSA_FLAG_NO_HANDLE_INHERIT, WSA_FLAG_OVERLAPPED,
2830
};
29-
#[cfg(feature = "all")]
30-
use windows_sys::Win32::Networking::WinSock::SO_PROTOCOL_INFOW;
3131
use windows_sys::Win32::System::Threading::INFINITE;
3232

3333
use crate::{MsgHdr, RecvFlags, SockAddr, TcpKeepalive, Type};

0 commit comments

Comments
 (0)