* autoload.cc (GetExtendedTcpTable): Remove.
(GetTcpTable): Remove. (CharNextExA): Remove. (FindWindowA): Remove. (ShowWindowAsync): Remove. * dcrt0.cc (disable_dep): Remove unused function. (dll_crt0_0): Drop comment babbling about TS & DEP. * fhandler_socket.cc (address_in_use): Remove unused function. * wincap.cc: Throughout, drop ts_has_dep_problem from wincaps. (wincapc::init): Drop code setting ts_has_dep_problem flag. * wincap.h (struct wincaps): Drop ts_has_dep_problem flags and method.
This commit is contained in:
@ -872,74 +872,6 @@ fhandler_socket::link (const char *newpath)
|
||||
return fhandler_base::link (newpath);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* This function doesn't work correctly. It has been called in bind to check
|
||||
if a local address is still in use, but it disables to bind in the
|
||||
SO_REUSEADDR case even if only an accepted socket is still using the
|
||||
local address, and even if said accepted socket is already in CLOSE_WAIT.
|
||||
I keep this function in the code for later reference only. */
|
||||
static inline bool
|
||||
address_in_use (const struct sockaddr *addr)
|
||||
{
|
||||
switch (addr->sa_family)
|
||||
{
|
||||
case AF_INET:
|
||||
{
|
||||
PMIB_TCPTABLE tab;
|
||||
PMIB_TCPROW entry;
|
||||
DWORD size = 0, i;
|
||||
struct sockaddr_in *in = (struct sockaddr_in *) addr;
|
||||
|
||||
if (GetTcpTable (NULL, &size, FALSE) == ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
tab = (PMIB_TCPTABLE) alloca (size += 16 * sizeof (PMIB_TCPROW));
|
||||
if (!GetTcpTable (tab, &size, FALSE))
|
||||
for (i = tab->dwNumEntries, entry = tab->table; i > 0;
|
||||
--i, ++entry)
|
||||
if (entry->dwLocalAddr == in->sin_addr.s_addr
|
||||
&& entry->dwLocalPort == in->sin_port
|
||||
&& entry->dwState >= MIB_TCP_STATE_LISTEN
|
||||
&& entry->dwState <= MIB_TCP_STATE_LAST_ACK)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AF_INET6:
|
||||
{
|
||||
/* This test works on XP SP2 and above which should cover almost
|
||||
all IPv6 users... */
|
||||
PMIB_TCP6TABLE_OWNER_PID tab;
|
||||
PMIB_TCP6ROW_OWNER_PID entry;
|
||||
DWORD size = 0, i;
|
||||
struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) addr;
|
||||
|
||||
if (GetExtendedTcpTable (NULL, &size, FALSE, AF_INET6,
|
||||
TCP_TABLE_OWNER_PID_ALL, 0)
|
||||
== ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
tab = (PMIB_TCP6TABLE_OWNER_PID)
|
||||
alloca (size += 16 * sizeof (PMIB_TCP6ROW_OWNER_PID));
|
||||
if (!GetExtendedTcpTable (tab, &size, FALSE, AF_INET6,
|
||||
TCP_TABLE_OWNER_PID_ALL, 0))
|
||||
for (i = tab->dwNumEntries, entry = tab->table; i > 0;
|
||||
--i, ++entry)
|
||||
if (IN6_ARE_ADDR_EQUAL (entry->ucLocalAddr,
|
||||
in6->sin6_addr.s6_addr)
|
||||
/* FIXME: Is testing for the scope required. too?!? */
|
||||
&& entry->dwLocalPort == in6->sin6_port
|
||||
&& entry->dwState >= MIB_TCP_STATE_LISTEN
|
||||
&& entry->dwState <= MIB_TCP_STATE_LAST_ACK)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
fhandler_socket::bind (const struct sockaddr *name, int namelen)
|
||||
{
|
||||
|
Reference in New Issue
Block a user