mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
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:
parent
cea1f1e0a6
commit
9127a1ca9d
2 changed files with 12 additions and 7 deletions
|
@ -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) ) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue