mirror of
https://github.com/reactos/reactos.git
synced 2024-09-27 21:16:34 +00:00
[0.4.9][AFD] ReceiveActivity: Don't return STATUS_FILE_CLOSED in case of FCB overread (#4972)
fix CORE-18328 'FileZilla 3.8 unable to list content of a remote directory due to undue ECONNRESET'
I tested to list the contents of ftp.heise.de and downloaded some files from its pub.
by porting back:
0.4.15-dev-5870-g 9f9b81e396
[AFD] ReceiveActivity: Don't return STATUS_FILE_CLOSED in case of FCB overread CORE-18328 (#4972)
This commit is contained in:
parent
3b78fdde21
commit
5b062078b3
|
@ -745,9 +745,6 @@ AfdDisconnect(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
||||||
FCB->Recv.Content = 0;
|
FCB->Recv.Content = 0;
|
||||||
FCB->Recv.BytesUsed = 0;
|
FCB->Recv.BytesUsed = 0;
|
||||||
|
|
||||||
/* Mark us as overread to complete future reads with an error */
|
|
||||||
FCB->Overread = TRUE;
|
|
||||||
|
|
||||||
/* Set a successful receive status to indicate a shutdown on overread */
|
/* Set a successful receive status to indicate a shutdown on overread */
|
||||||
FCB->LastReceiveStatus = STATUS_SUCCESS;
|
FCB->LastReceiveStatus = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
|
|
@ -175,23 +175,15 @@ static NTSTATUS ReceiveActivity( PAFD_FCB FCB, PIRP Irp ) {
|
||||||
TotalBytesCopied));
|
TotalBytesCopied));
|
||||||
UnlockBuffers( RecvReq->BufferArray,
|
UnlockBuffers( RecvReq->BufferArray,
|
||||||
RecvReq->BufferCount, FALSE );
|
RecvReq->BufferCount, FALSE );
|
||||||
if (FCB->Overread && FCB->LastReceiveStatus == STATUS_SUCCESS)
|
|
||||||
{
|
|
||||||
/* Overread after a graceful disconnect so complete with an error */
|
|
||||||
Status = STATUS_FILE_CLOSED;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Unexpected disconnect by the remote host or initial read after a graceful disconnect */
|
|
||||||
Status = FCB->LastReceiveStatus;
|
Status = FCB->LastReceiveStatus;
|
||||||
}
|
|
||||||
NextIrp->IoStatus.Status = Status;
|
NextIrp->IoStatus.Status = Status;
|
||||||
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 */
|
||||||
|
|
|
@ -159,7 +159,7 @@ typedef struct _AFD_STORED_DATAGRAM {
|
||||||
} AFD_STORED_DATAGRAM, *PAFD_STORED_DATAGRAM;
|
} AFD_STORED_DATAGRAM, *PAFD_STORED_DATAGRAM;
|
||||||
|
|
||||||
typedef struct _AFD_FCB {
|
typedef struct _AFD_FCB {
|
||||||
BOOLEAN Locked, Critical, Overread, NonBlocking, OobInline, TdiReceiveClosed, SendClosed;
|
BOOLEAN Locked, Critical, NonBlocking, OobInline, TdiReceiveClosed, SendClosed;
|
||||||
UINT State, Flags, GroupID, GroupType;
|
UINT State, Flags, GroupID, GroupType;
|
||||||
KIRQL OldIrql;
|
KIRQL OldIrql;
|
||||||
UINT LockCount;
|
UINT LockCount;
|
||||||
|
|
Loading…
Reference in a new issue