mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
wfreerdp-server: improved peer tracking, added ability to disconnect individual peers
This commit is contained in:
parent
ecad702c98
commit
5d0a53a3b3
@ -206,7 +206,12 @@ void wf_info_peer_register(wfInfo* wfi, wfPeerContext* context)
|
|||||||
int i;
|
int i;
|
||||||
int peerId;
|
int peerId;
|
||||||
//todo: reject peer if we have WF_INFO_MAXPEERS connected
|
//todo: reject peer if we have WF_INFO_MAXPEERS connected
|
||||||
|
if (wfi->peerCount == WF_INFO_MAXPEERS)
|
||||||
|
{
|
||||||
|
context->socketClose = TRUE;
|
||||||
|
wf_info_unlock(wfi);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
context->info = wfi;
|
context->info = wfi;
|
||||||
context->updateEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
context->updateEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include "wf_interface.h"
|
#include "wf_interface.h"
|
||||||
|
|
||||||
#define WF_INFO_DEFAULT_FPS 24
|
#define WF_INFO_DEFAULT_FPS 24
|
||||||
#define WF_INFO_MAXPEERS 32
|
#define WF_INFO_MAXPEERS 2
|
||||||
|
|
||||||
int wf_info_lock(wfInfo* wfi);
|
int wf_info_lock(wfInfo* wfi);
|
||||||
int wf_info_try_lock(wfInfo* wfi, DWORD dwMilliseconds);
|
int wf_info_try_lock(wfInfo* wfi, DWORD dwMilliseconds);
|
||||||
|
@ -220,6 +220,9 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam)
|
|||||||
client->Initialize(client);
|
client->Initialize(client);
|
||||||
context = (wfPeerContext*) client->context;
|
context = (wfPeerContext*) client->context;
|
||||||
|
|
||||||
|
if (context->socketClose)
|
||||||
|
return 0;
|
||||||
|
|
||||||
wfi = context->info;
|
wfi = context->info;
|
||||||
|
|
||||||
if (wfi->input_disabled == TRUE)
|
if (wfi->input_disabled == TRUE)
|
||||||
|
@ -63,10 +63,10 @@ DWORD WINAPI wf_update_thread(LPVOID lpParam)
|
|||||||
wf_update_encode(wfi);
|
wf_update_encode(wfi);
|
||||||
|
|
||||||
//printf("Start of parallel sending\n");
|
//printf("Start of parallel sending\n");
|
||||||
|
index = 0;
|
||||||
for (peerindex = 0; peerindex < wfi->peerCount; peerindex++)
|
for (peerindex = 0; peerindex < wfi->peerCount; peerindex++)
|
||||||
{
|
{
|
||||||
for (index = 0; index < WF_INFO_MAXPEERS; index++)
|
for (; index < WF_INFO_MAXPEERS; index++)
|
||||||
{
|
{
|
||||||
if (wfi->peers[index] && wfi->peers[index]->activated)
|
if (wfi->peers[index] && wfi->peers[index]->activated)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user