Noticed that I had not used the right status for EOF when consolidating

some code.  Added a flag that governs whether we are after or at EOF.

svn path=/trunk/; revision=13737
This commit is contained in:
Art Yerkes 2005-02-25 03:02:45 +00:00
parent cea1f1e0a6
commit 9127a1ca9d
2 changed files with 12 additions and 7 deletions

View file

@ -123,7 +123,7 @@ static VOID ProcessClose( PAFD_FCB FCB ) {
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 @@ static VOID ProcessClose( PAFD_FCB FCB ) {
}
/* 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 @@ AfdConnectedSocketReadData(PDEVICE_OBJECT DeviceObject, PIRP Irp,
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) ) {

View file

@ -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