wfreerdp-server: fix parallel send

This commit is contained in:
Corey C 2012-10-06 17:09:53 -04:00
parent 715a172fe8
commit ecad702c98
2 changed files with 10 additions and 5 deletions

View File

@ -250,7 +250,7 @@ void wf_info_peer_unregister(wfInfo* wfi, wfPeerContext* context)
wfi->peerCount--;
CloseHandle(context->updateEvent);
printf("Unregistering Peer: %d\n", wfi->peerCount);
printf("Unregistering Peer: id=%d, #=%d\n", peerId, wfi->peerCount);
#ifdef WITH_WIN8
if (wfi->peerCount == 0)

View File

@ -37,6 +37,7 @@
DWORD WINAPI wf_update_thread(LPVOID lpParam)
{
int index;
int peerindex;
DWORD fps;
wfInfo* wfi;
DWORD beg, end;
@ -63,15 +64,19 @@ DWORD WINAPI wf_update_thread(LPVOID lpParam)
//printf("Start of parallel sending\n");
for (index = 0; index < wfi->peerCount; index++)
for (peerindex = 0; peerindex < wfi->peerCount; peerindex++)
{
if (wfi->peers[index]->activated)
for (index = 0; index < WF_INFO_MAXPEERS; index++)
{
if (wfi->peers[index] && wfi->peers[index]->activated)
{
//printf("Setting event for %d of %d\n", index + 1, wfi->activePeerCount);
SetEvent(((wfPeerContext*) wfi->peers[index]->context)->updateEvent);
}
}
}
for (index = 0; index < wfi->activePeerCount; index++)
{
//printf("Waiting for %d of %d\n", index + 1, wfi->activePeerCount);