[ros-diffs] [cgutman] 52224: [AFD] - Only indicate that receive is possible if there are no pending receive IRPs waiting for data - Don't attempt to receive on a connection which has been closed in the receive...

cgutman at svn.reactos.org cgutman at svn.reactos.org
Tue Jun 14 02:18:22 UTC 2011


Author: cgutman
Date: Tue Jun 14 02:18:20 2011
New Revision: 52224

URL: http://svn.reactos.org/svn/reactos?rev=52224&view=rev
Log:
[AFD]
- Only indicate that receive is possible if there are no pending receive IRPs waiting for data
- Don't attempt to receive on a connection which has been closed in the receive direction

Modified:
    trunk/reactos/drivers/network/afd/afd/read.c

Modified: trunk/reactos/drivers/network/afd/afd/read.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/read.c?rev=52224&r1=52223&r2=52224&view=diff
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] Tue Jun 14 02:18:20 2011
@@ -49,7 +49,8 @@
 static VOID RefillSocketBuffer( PAFD_FCB FCB ) {
 	NTSTATUS Status;
 
-	if( !FCB->ReceiveIrp.InFlightRequest ) {
+	if( !FCB->ReceiveIrp.InFlightRequest &&
+        !(FCB->PollState & (AFD_EVENT_CLOSE | AFD_EVENT_ABORT)) ) {
 		AFD_DbgPrint(MID_TRACE,("Replenishing buffer\n"));
 
 		Status = TdiReceive( &FCB->ReceiveIrp.InFlightRequest,
@@ -216,7 +217,8 @@
 		}
     }
 
-    if( FCB->Recv.Content - FCB->Recv.BytesUsed ) {
+    if( FCB->Recv.Content - FCB->Recv.BytesUsed &&
+        IsListEmpty(&FCB->PendingIrpList[FUNCTION_RECV]) ) {
 		FCB->PollState |= AFD_EVENT_RECEIVE;
         FCB->PollStatus[FD_READ_BIT] = STATUS_SUCCESS;
         PollReeval( FCB->DeviceExt, FCB->FileObject );
@@ -576,7 +578,7 @@
 		}
     }
 
-    if( !IsListEmpty( &FCB->DatagramList ) ) {
+    if( !IsListEmpty( &FCB->DatagramList ) && IsListEmpty(&FCB->PendingIrpList[FUNCTION_RECV]) ) {
 		AFD_DbgPrint(MID_TRACE,("Signalling\n"));
 		FCB->PollState |= AFD_EVENT_RECEIVE;
         FCB->PollStatus[FD_READ_BIT] = STATUS_SUCCESS;




More information about the Ros-diffs mailing list