Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14576
Modified Files:
win32file.i
Log Message:
Fix 1508459: AcceptEx needs to return anerror code
win32file.AcceptEx now returns either 0, or ERROR_IO_PENDING
Index: win32file.i
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** win32file.i 14 Aug 2006 03:33:11 -0000 1.61
--- win32file.i 30 Aug 2006 12:33:58 -0000 1.62
***************
*** 1835,1838 ****
--- 1835,1841 ----
%{
// @pyswig |AcceptEx|Version of accept that uses Overlapped I/O
+ // @rdesc The result is 0 or ERROR_IO_PENDING. All other values will raise
+ // win32file.error. Specifically: if the win32 function returns FALSE,
+ // WSAGetLastError() is checked for ERROR_IO_PENDING.
static PyObject *MyAcceptEx
(
***************
*** 1853,1857 ****
void *buf = NULL;
DWORD cBytesRecvd = 0;
! int rc;
int iMinBufferSize = (sizeof(SOCKADDR_IN) + 16) * 2;
WSAPROTOCOL_INFO wsProtInfo;
--- 1856,1861 ----
void *buf = NULL;
DWORD cBytesRecvd = 0;
! BOOL ok;
! int rc = 0;
int iMinBufferSize = (sizeof(SOCKADDR_IN) + 16) * 2;
WSAPROTOCOL_INFO wsProtInfo;
***************
*** 1931,1935 ****
// Phew... finally, all the arguments are converted...
Py_BEGIN_ALLOW_THREADS
! rc = AcceptEx(
sListening,
sAccepting,
--- 1935,1939 ----
// Phew... finally, all the arguments are converted...
Py_BEGIN_ALLOW_THREADS
! ok = AcceptEx(
sListening,
sAccepting,
***************
*** 1941,1945 ****
pOverlapped);
Py_END_ALLOW_THREADS
! if (!rc)
{
rc = WSAGetLastError();
--- 1945,1949 ----
pOverlapped);
Py_END_ALLOW_THREADS
! if (!ok)
{
rc = WSAGetLastError();
***************
*** 1950,1957 ****
}
}
-
Py_DECREF(pORB);
! Py_INCREF(Py_None);
! rv = Py_None;
Cleanup:
return rv;
--- 1954,1959 ----
}
}
Py_DECREF(pORB);
! rv = PyInt_FromLong(rc);
Cleanup:
return rv;
|