[pywin32-checkins] pywin32/win32/src win32file.i,1.99,1.100
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
|
From: Roger U. <ru...@us...> - 2009-02-01 16:50:42
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8846 Modified Files: win32file.i Log Message: In ConnectEx, incorporate changes from latest version of patch Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** win32file.i 26 Jan 2009 00:47:31 -0000 1.99 --- win32file.i 1 Feb 2009 16:50:36 -0000 1.100 *************** *** 1825,1832 **** } memset(&hints, 0, sizeof(hints)); ! hints.ai_family = AF_INET; ! hints.ai_socktype = SOCK_STREAM; ! hints.ai_protocol = IPPROTO_TCP; error = getaddrinfo(hptr, pptr, &hints, &res); if (error) --- 1825,1842 ---- } + WSAPROTOCOL_INFO prot_info; + int prot_info_len = sizeof(WSAPROTOCOL_INFO); + error = getsockopt(sConnecting, SOL_SOCKET, SO_PROTOCOL_INFO, + (char*)&prot_info, &prot_info_len); + if (error) + { + PyWin_SetAPIError("getsockopt", WSAGetLastError()); + return NULL; + } + memset(&hints, 0, sizeof(hints)); ! hints.ai_family = prot_info.iAddressFamily; ! hints.ai_socktype = prot_info.iSocketType; ! hints.ai_protocol = prot_info.iProtocol; error = getaddrinfo(hptr, pptr, &hints, &res); if (error) |