- Complete receive requests with the correct status if the socket is unexpectedly closed

svn path=/trunk/; revision=52400
This commit is contained in:
Cameron Gutman 2011-06-21 13:02:42 +00:00
parent 2792c9b294
commit 2b116b187c

View file

@ -163,14 +163,12 @@ static NTSTATUS ReceiveActivity( PAFD_FCB FCB, PIRP Irp ) {
TotalBytesCopied)); TotalBytesCopied));
UnlockBuffers( RecvReq->BufferArray, UnlockBuffers( RecvReq->BufferArray,
RecvReq->BufferCount, FALSE ); RecvReq->BufferCount, FALSE );
Status = NextIrp->IoStatus.Status = Status = NextIrp->IoStatus.Status = FCB->PollStatus[FD_CLOSE_BIT];
FCB->Overread ? STATUS_END_OF_FILE : STATUS_SUCCESS;
NextIrp->IoStatus.Information = 0; NextIrp->IoStatus.Information = 0;
if( NextIrp == Irp ) RetStatus = Status; if( NextIrp == Irp ) RetStatus = Status;
if( NextIrp->MdlAddress ) UnlockRequest( NextIrp, IoGetCurrentIrpStackLocation( NextIrp ) ); if( NextIrp->MdlAddress ) UnlockRequest( NextIrp, IoGetCurrentIrpStackLocation( NextIrp ) );
(void)IoSetCancelRoutine(NextIrp, NULL); (void)IoSetCancelRoutine(NextIrp, NULL);
IoCompleteRequest( NextIrp, IO_NETWORK_INCREMENT ); IoCompleteRequest( NextIrp, IO_NETWORK_INCREMENT );
FCB->Overread = TRUE;
} }
} else { } else {
/* Kick the user that receive would be possible now */ /* Kick the user that receive would be possible now */