mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[AFD]
- Fix several bugs related to the FD_WRITE event - We would not set the sendable poll state if the socket had data waiting to be sent even if there was buffer space - We did not set the poll state after performing a send - We did not clear the sendable poll state if we ran out of buffer space svn path=/trunk/; revision=52492
This commit is contained in:
parent
ab849501e7
commit
97b25874fc
1 changed files with 25 additions and 7 deletions
|
@ -156,11 +156,21 @@ static NTSTATUS NTAPI SendComplete
|
|||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (FCB->Send.Size - FCB->Send.BytesUsed != 0)
|
||||
{
|
||||
FCB->PollState |= AFD_EVENT_SEND;
|
||||
FCB->PollStatus[FD_WRITE_BIT] = STATUS_SUCCESS;
|
||||
PollReeval( FCB->DeviceExt, FCB->FileObject );
|
||||
}
|
||||
else
|
||||
{
|
||||
FCB->PollState &= ~AFD_EVENT_SEND;
|
||||
}
|
||||
|
||||
/* Some data is still waiting */
|
||||
if( FCB->Send.BytesUsed ) {
|
||||
FCB->PollState &= ~AFD_EVENT_SEND;
|
||||
|
||||
if( FCB->Send.BytesUsed )
|
||||
{
|
||||
Status = TdiSend( &FCB->SendIrp.InFlightRequest,
|
||||
FCB->Connection.Object,
|
||||
0,
|
||||
|
@ -171,10 +181,6 @@ static NTSTATUS NTAPI SendComplete
|
|||
FCB );
|
||||
|
||||
RetryDisconnectCompletion(FCB);
|
||||
} else {
|
||||
FCB->PollState |= AFD_EVENT_SEND;
|
||||
FCB->PollStatus[FD_WRITE_BIT] = STATUS_SUCCESS;
|
||||
PollReeval( FCB->DeviceExt, FCB->FileObject );
|
||||
}
|
||||
|
||||
SocketStateUnlock( FCB );
|
||||
|
@ -388,6 +394,7 @@ AfdConnectedSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|||
}
|
||||
else
|
||||
{
|
||||
FCB->PollState &= ~AFD_EVENT_SEND;
|
||||
if( SendReq->AfdFlags & AFD_IMMEDIATE ) {
|
||||
AFD_DbgPrint(MID_TRACE,("Nonblocking\n"));
|
||||
UnlockBuffers( SendReq->BufferArray, SendReq->BufferCount, FALSE );
|
||||
|
@ -417,6 +424,17 @@ AfdConnectedSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|||
Status, TotalBytesCopied));
|
||||
}
|
||||
|
||||
if (SpaceAvail)
|
||||
{
|
||||
FCB->PollState |= AFD_EVENT_SEND;
|
||||
FCB->PollStatus[FD_WRITE_BIT] = STATUS_SUCCESS;
|
||||
PollReeval( FCB->DeviceExt, FCB->FileObject );
|
||||
}
|
||||
else
|
||||
{
|
||||
FCB->PollState &= ~AFD_EVENT_SEND;
|
||||
}
|
||||
|
||||
RetryDisconnectCompletion(FCB);
|
||||
|
||||
return UnlockAndMaybeComplete
|
||||
|
|
Loading…
Reference in a new issue