mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
bpo-39148: enable ipv6 for datagrams in Proactor (GH-19121)
Ifdef is not necessary, as AF_INET6 is supported from Windows Vista, and other code in overlapped.c uses AF_INET6 and is not ifdef'd. Change the raised exception so users are not fooled to think it comes from Windows API. Automerge-Triggered-By: @njsmith
This commit is contained in:
parent
da742ba826
commit
442634c42f
3 changed files with 17 additions and 8 deletions
|
|
@ -670,7 +670,6 @@ make_ipv4_addr(const struct sockaddr_in *addr)
|
|||
return PyUnicode_FromString(buf);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
/* Convert IPv6 sockaddr to a Python str. */
|
||||
|
||||
static PyObject *
|
||||
|
|
@ -683,7 +682,6 @@ make_ipv6_addr(const struct sockaddr_in6 *addr)
|
|||
}
|
||||
return PyUnicode_FromString(buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
static PyObject*
|
||||
unparse_address(LPSOCKADDR Address, DWORD Length)
|
||||
|
|
@ -701,7 +699,6 @@ unparse_address(LPSOCKADDR Address, DWORD Length)
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
#ifdef ENABLE_IPV6
|
||||
case AF_INET6: {
|
||||
const struct sockaddr_in6 *a = (const struct sockaddr_in6 *)Address;
|
||||
PyObject *addrobj = make_ipv6_addr(a);
|
||||
|
|
@ -716,9 +713,9 @@ unparse_address(LPSOCKADDR Address, DWORD Length)
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
#endif /* ENABLE_IPV6 */
|
||||
default: {
|
||||
return SetFromWindowsErr(ERROR_INVALID_PARAMETER);
|
||||
PyErr_SetString(PyExc_ValueError, "recvfrom returned unsupported address family");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue