Skip to content

Commit

Permalink
refomatted
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Aug 12, 2023
1 parent 6d82932 commit be18b4e
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions crates/shadowsocks/src/net/sys/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ use std::{
io::{AsRawSocket, FromRawSocket, IntoRawSocket, RawSocket},
},
pin::Pin,
ptr, slice,
ptr,
slice,
task::{self, Poll},
time::{Duration, Instant},
};
Expand All @@ -29,13 +30,32 @@ use windows_sys::{
Win32::{
Foundation::{BOOL, ERROR_BUFFER_OVERFLOW, ERROR_NO_DATA, ERROR_SUCCESS},
NetworkManagement::IpHelper::{
if_nametoindex, GetAdaptersAddresses, GAA_FLAG_SKIP_ANYCAST, GAA_FLAG_SKIP_DNS_SERVER,
GAA_FLAG_SKIP_MULTICAST, GAA_FLAG_SKIP_UNICAST, IP_ADAPTER_ADDRESSES_LH,
if_nametoindex,
GetAdaptersAddresses,
GAA_FLAG_SKIP_ANYCAST,
GAA_FLAG_SKIP_DNS_SERVER,
GAA_FLAG_SKIP_MULTICAST,
GAA_FLAG_SKIP_UNICAST,
IP_ADAPTER_ADDRESSES_LH,
},
Networking::WinSock::{
htonl, setsockopt, WSAGetLastError, WSAIoctl, AF_UNSPEC, IPPROTO_IP, IPPROTO_IPV6, IPPROTO_TCP,
IPV6_MTU_DISCOVER, IPV6_UNICAST_IF, IP_MTU_DISCOVER, IP_PMTUDISC_DO, IP_UNICAST_IF, SIO_UDP_CONNRESET,
SOCKET, SOCKET_ERROR, TCP_FASTOPEN,
htonl,
setsockopt,
WSAGetLastError,
WSAIoctl,
AF_UNSPEC,
IPPROTO_IP,
IPPROTO_IPV6,
IPPROTO_TCP,
IPV6_MTU_DISCOVER,
IPV6_UNICAST_IF,
IP_MTU_DISCOVER,
IP_PMTUDISC_DO,
IP_UNICAST_IF,
SIO_UDP_CONNRESET,
SOCKET,
SOCKET_ERROR,
TCP_FASTOPEN,
},
},
};
Expand All @@ -46,7 +66,9 @@ const FALSE: BOOL = 0;
use crate::net::{
is_dual_stack_addr,
sys::{set_common_sockopt_for_connect, socket_bind_dual_stack},
AcceptOpts, AddrFamily, ConnectOpts,
AcceptOpts,
AddrFamily,
ConnectOpts,
};

/// A `TcpStream` that supports TFO (TCP Fast Open)
Expand Down

0 comments on commit be18b4e

Please sign in to comment.