8000 Sync overlapped.c with CPython · python/asyncio@d029e33 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

Commit d029e33

Browse files
committed
Sync overlapped.c with CPython
1 parent cecfb3d commit d029e33

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

overlapped.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -973,28 +973,28 @@ Overlapped_AcceptEx(OverlappedObject *self, PyObject *args)
973973
static int
974974
parse_address(PyObject *obj, SOCKADDR *Address, int Length)
975975
{
976-
char *Host;
976+
Py_UNICODE *Host;
977977
unsigned short Port;
978978
unsigned long FlowInfo;
979979
unsigned long ScopeId;
980980

981981
memset(Address, 0, Length);
982982

983-
if (PyArg_ParseTuple(obj, "sH", &Host, &Port))
983+
if (PyArg_ParseTuple(obj, "uH", &Host, &Port))
984984
{
985985
Address->sa_family = AF_INET;
986-
if (WSAStringToAddressA(Host, AF_INET, NULL, Address, &Length) < 0) {
986+
if (WSAStringToAddressW(Host, AF_INET, NULL, Address, &Length) < 0) {
987987
SetFromWindowsErr(WSAGetLastError());
988988
return -1;
989989
}
990990
((SOCKADDR_IN*)Address)->sin_port = htons(Port);
991991
return Length;
992992
}
993-
else if (PyArg_ParseTuple(obj, "sHkk", &Host, &Port, &FlowInfo, &ScopeId))
993+
else if (PyArg_ParseTuple(obj, "uHkk", &Host, &Port, &FlowInfo, &ScopeId))
994994
{
995995
PyErr_Clear();
996996
Address->sa_family = AF_INET6;
997-
if (WSAStringToAddressA(Host, AF_INET6, NULL, Address, &Length) < 0) {
997+
if (WSAStringToAddressW(Host, AF_INET6, NULL, Address, &Length) < 0) {
998998
SetFromWindowsErr(WSAGetLastError());
999999
return -1;
10001000
}

0 commit comments

Comments
 (0)
0