[server,proxy] automatic intercept for drdynvc

* By default no special treatment for drdynvc
* If any of the configuration options requires drdynvc intercept do that
  independently of the intercept/passthrough lists
This commit is contained in:
akallabeth 2024-07-25 11:15:52 +02:00
parent 784f9eab24
commit eaf0bd8a69
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5

View File

@ -26,6 +26,7 @@
#include <freerdp/server/proxy/proxy_log.h>
#include <freerdp/server/proxy/proxy_server.h>
#include <freerdp/channels/drdynvc.h>
#include "pf_client.h"
#include "pf_utils.h"
@ -52,6 +53,31 @@ static BOOL ChannelId_Compare(const void* pv1, const void* pv2)
return (*v1 == *v2);
}
static BOOL dyn_intercept(pServerContext* ps, const char* name)
{
if (strncmp(DRDYNVC_SVC_CHANNEL_NAME, name, sizeof(DRDYNVC_SVC_CHANNEL_NAME)) != 0)
return FALSE;
WINPR_ASSERT(ps);
WINPR_ASSERT(ps->pdata);
const proxyConfig* cfg = ps->pdata->config;
WINPR_ASSERT(cfg);
if (!cfg->GFX)
return TRUE;
if (!cfg->AudioOutput)
return TRUE;
if (!cfg->AudioInput)
return TRUE;
if (!cfg->Multitouch)
return TRUE;
if (!cfg->VideoRedirection)
return TRUE;
if (!cfg->CameraRedirection)
return TRUE;
return FALSE;
}
pServerStaticChannelContext* StaticChannelContext_new(pServerContext* ps, const char* name,
UINT32 id)
{
@ -77,6 +103,8 @@ pServerStaticChannelContext* StaticChannelContext_new(pServerContext* ps, const
&channel) &&
channel.intercept)
ret->channelMode = PF_UTILS_CHANNEL_INTERCEPT;
else if (dyn_intercept(ps, name))
ret->channelMode = PF_UTILS_CHANNEL_INTERCEPT;
else
ret->channelMode = pf_utils_get_channel_mode(ps->pdata->config, name);
return ret;