Count each handle which has pending events only once, independent of the
number
of pending events. Fixes bug 779.
Modified: trunk/reactos/lib/msafd/misc/dllmain.c
_____
Modified: trunk/reactos/lib/msafd/misc/dllmain.c
--- trunk/reactos/lib/msafd/misc/dllmain.c 2005-09-17 21:02:38 UTC
(rev 17901)
+++ trunk/reactos/lib/msafd/misc/dllmain.c 2005-09-17 21:22:47 UTC
(rev 17902)
@@ -596,6 +596,7 @@
PVOID PollBuffer;
ULONG i, j = 0, x;
HANDLE SockEvent;
+ BOOL HandleCounted;
Status = NtCreateEvent( &SockEvent, GENERIC_READ | GENERIC_WRITE,
NULL, 1, FALSE );
@@ -690,6 +691,7 @@
/* Return in FDSET Format */
for (i = 0; i < HandleCount; i++) {
+ HandleCounted = FALSE;
for(x = 1; x; x<<=1) {
switch (PollInfo->Handles[i].Events & x) {
case AFD_EVENT_RECEIVE:
@@ -700,7 +702,10 @@
AFD_DbgPrint(MID_TRACE,("Event %x on handle %x\n",
PollInfo->Handles[i].Events,
PollInfo->Handles[i].Handle));
- OutCount++;
+ if (! HandleCounted) {
+ OutCount++;
+ HandleCounted = TRUE;
+ }
if( readfds ) FD_SET(PollInfo->Handles[i].Handle,
readfds);
break;
@@ -708,7 +713,10 @@
AFD_DbgPrint(MID_TRACE,("Event %x on handle %x\n",
PollInfo->Handles[i].Events,
PollInfo->Handles[i].Handle));
- OutCount++;
+ if (! HandleCounted) {
+ OutCount++;
+ HandleCounted = TRUE;
+ }
if( writefds ) FD_SET(PollInfo->Handles[i].Handle,
writefds);
break;
@@ -716,7 +724,10 @@
AFD_DbgPrint(MID_TRACE,("Event %x on handle %x\n",
PollInfo->Handles[i].Events,
PollInfo->Handles[i].Handle));
- OutCount++;
+ if (! HandleCounted) {
+ OutCount++;
+ HandleCounted = TRUE;
+ }
if( exceptfds ) FD_SET(PollInfo->Handles[i].Handle,
exceptfds);
break;
}
Show replies by date