--- trunk/reactos/drivers/net/afd/afd/read.c 2005-02-24 22:20:43 UTC (rev 13736)
+++ trunk/reactos/drivers/net/afd/afd/read.c 2005-02-25 03:02:45 UTC (rev 13737)
@@ -123,7 +123,7 @@
PIRP NextIrp;
AFD_DbgPrint(MID_TRACE,("Socket shutdown from remote side\n"));
-
+
/* Kill remaining recv irps */
while( !IsListEmpty( &FCB->PendingIrpList[FUNCTION_RECV] ) ) {
NextIrpEntry =
@@ -138,7 +138,7 @@
}
/* Handle closing signal */
- FCB->PollState |= AFD_EVENT_DISCONNECT;
+ FCB->PollState |= AFD_EVENT_DISCONNECT | SOCKET_STATE_EOF_READ;
PollReeval( FCB->DeviceExt, FCB->FileObject );
}
@@ -307,15 +307,19 @@
Status = STATUS_SUCCESS;
}
} else {
- AFD_DbgPrint(MID_TRACE,("EOF Happened already\n"));
- FCB->Recv.Content = 0;
- FCB->Recv.BytesUsed = 0;
- Status = STATUS_END_OF_FILE;
+ if( FCB->PollState & SOCKET_STATE_EOF_READ )
+ Status = STATUS_END_OF_FILE;
+ else
+ Status = STATUS_SUCCESS;
+
+ AFD_DbgPrint(MID_TRACE,("EOF Happened already\n"));
+ FCB->Recv.Content = 0;
+ FCB->Recv.BytesUsed = 0;
ProcessClose( FCB );
return UnlockAndMaybeComplete
- ( FCB, STATUS_SUCCESS, Irp, 0, NULL, FALSE);
+ ( FCB, Status, Irp, 0, NULL, FALSE);
}
if( NT_SUCCESS(Status) ) {
--- trunk/reactos/drivers/net/afd/include/afd.h 2005-02-24 22:20:43 UTC (rev 13736)
+++ trunk/reactos/drivers/net/afd/include/afd.h 2005-02-25 03:02:45 UTC (rev 13737)
@@ -44,6 +44,7 @@
#define SOCKET_STATE_CONNECTED 3
#define SOCKET_STATE_LISTENING 4
#define SOCKET_STATE_MASK 0x0000ffff
+#define SOCKET_STATE_EOF_READ 0x20000000
#define SOCKET_STATE_LOCKED 0x40000000
#define SOCKET_STATE_NEW 0x80000000
#define SOCKET_STATE_CLOSED 0x00000100