mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
Count each handle which has pending events only once, independent of the number
of pending events. Fixes bug 779. svn path=/trunk/; revision=17902
This commit is contained in:
parent
8e38aa25a1
commit
5f8481f284
1 changed files with 14 additions and 3 deletions
|
@ -596,6 +596,7 @@ WSPSelect(
|
||||||
PVOID PollBuffer;
|
PVOID PollBuffer;
|
||||||
ULONG i, j = 0, x;
|
ULONG i, j = 0, x;
|
||||||
HANDLE SockEvent;
|
HANDLE SockEvent;
|
||||||
|
BOOL HandleCounted;
|
||||||
|
|
||||||
Status = NtCreateEvent( &SockEvent, GENERIC_READ | GENERIC_WRITE,
|
Status = NtCreateEvent( &SockEvent, GENERIC_READ | GENERIC_WRITE,
|
||||||
NULL, 1, FALSE );
|
NULL, 1, FALSE );
|
||||||
|
@ -690,6 +691,7 @@ WSPSelect(
|
||||||
|
|
||||||
/* Return in FDSET Format */
|
/* Return in FDSET Format */
|
||||||
for (i = 0; i < HandleCount; i++) {
|
for (i = 0; i < HandleCount; i++) {
|
||||||
|
HandleCounted = FALSE;
|
||||||
for(x = 1; x; x<<=1) {
|
for(x = 1; x; x<<=1) {
|
||||||
switch (PollInfo->Handles[i].Events & x) {
|
switch (PollInfo->Handles[i].Events & x) {
|
||||||
case AFD_EVENT_RECEIVE:
|
case AFD_EVENT_RECEIVE:
|
||||||
|
@ -700,7 +702,10 @@ WSPSelect(
|
||||||
AFD_DbgPrint(MID_TRACE,("Event %x on handle %x\n",
|
AFD_DbgPrint(MID_TRACE,("Event %x on handle %x\n",
|
||||||
PollInfo->Handles[i].Events,
|
PollInfo->Handles[i].Events,
|
||||||
PollInfo->Handles[i].Handle));
|
PollInfo->Handles[i].Handle));
|
||||||
|
if (! HandleCounted) {
|
||||||
OutCount++;
|
OutCount++;
|
||||||
|
HandleCounted = TRUE;
|
||||||
|
}
|
||||||
if( readfds ) FD_SET(PollInfo->Handles[i].Handle, readfds);
|
if( readfds ) FD_SET(PollInfo->Handles[i].Handle, readfds);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -708,7 +713,10 @@ WSPSelect(
|
||||||
AFD_DbgPrint(MID_TRACE,("Event %x on handle %x\n",
|
AFD_DbgPrint(MID_TRACE,("Event %x on handle %x\n",
|
||||||
PollInfo->Handles[i].Events,
|
PollInfo->Handles[i].Events,
|
||||||
PollInfo->Handles[i].Handle));
|
PollInfo->Handles[i].Handle));
|
||||||
|
if (! HandleCounted) {
|
||||||
OutCount++;
|
OutCount++;
|
||||||
|
HandleCounted = TRUE;
|
||||||
|
}
|
||||||
if( writefds ) FD_SET(PollInfo->Handles[i].Handle, writefds);
|
if( writefds ) FD_SET(PollInfo->Handles[i].Handle, writefds);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -716,7 +724,10 @@ WSPSelect(
|
||||||
AFD_DbgPrint(MID_TRACE,("Event %x on handle %x\n",
|
AFD_DbgPrint(MID_TRACE,("Event %x on handle %x\n",
|
||||||
PollInfo->Handles[i].Events,
|
PollInfo->Handles[i].Events,
|
||||||
PollInfo->Handles[i].Handle));
|
PollInfo->Handles[i].Handle));
|
||||||
|
if (! HandleCounted) {
|
||||||
OutCount++;
|
OutCount++;
|
||||||
|
HandleCounted = TRUE;
|
||||||
|
}
|
||||||
if( exceptfds ) FD_SET(PollInfo->Handles[i].Handle, exceptfds);
|
if( exceptfds ) FD_SET(PollInfo->Handles[i].Handle, exceptfds);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue