mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
event.c: Don't infinite loop while completing a zero-length read.
tcp.c: Correctly pass on length in recv. svn path=/trunk/; revision=10999
This commit is contained in:
parent
0dbb29fa23
commit
d774499bf8
2 changed files with 8 additions and 4 deletions
|
@ -91,12 +91,15 @@ int TCPSocketState(void *ClientData,
|
||||||
("Completing Receive Request: %x\n",
|
("Completing Receive Request: %x\n",
|
||||||
Bucket->Request));
|
Bucket->Request));
|
||||||
|
|
||||||
Complete( Bucket->Request.RequestContext,
|
Complete( Bucket->Request.RequestContext,
|
||||||
STATUS_SUCCESS,
|
STATUS_SUCCESS, Received );
|
||||||
Received );
|
} else if( Status == STATUS_SUCCESS ) {
|
||||||
} else {
|
|
||||||
InsertHeadList( &Connection->ReceiveRequest,
|
InsertHeadList( &Connection->ReceiveRequest,
|
||||||
&Bucket->Entry );
|
&Bucket->Entry );
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
Complete( Bucket->Request.RequestContext, Status, 0 );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -317,6 +317,7 @@ NTSTATUS TCPReceiveData
|
||||||
Status = STATUS_PENDING;
|
Status = STATUS_PENDING;
|
||||||
} else {
|
} else {
|
||||||
TI_DbgPrint(MID_TRACE,("Got status %x, bytes %d\n", Status, Received));
|
TI_DbgPrint(MID_TRACE,("Got status %x, bytes %d\n", Status, Received));
|
||||||
|
*BytesReceived = Received;
|
||||||
}
|
}
|
||||||
|
|
||||||
KeReleaseSpinLock(&Connection->Lock, OldIrql);
|
KeReleaseSpinLock(&Connection->Lock, OldIrql);
|
||||||
|
|
Loading…
Reference in a new issue