From: kubistika Date: Sat, 3 Aug 2019 13:46:20 +0000 (+0300) Subject: server: proxy: channels: only open allowed channels X-Git-Tag: 2.0.0~395^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=595f23b8fe2bd8c60a655634721b7df74cdfbc41;p=platform%2Fupstream%2Ffreerdp.git server: proxy: channels: only open allowed channels --- diff --git a/server/proxy/pf_channels.c b/server/proxy/pf_channels.c index 922a29b..ff73137 100644 --- a/server/proxy/pf_channels.c +++ b/server/proxy/pf_channels.c @@ -55,25 +55,25 @@ void pf_OnChannelConnectedEventHandler(void* data, } else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) { - pc->gfx = (RdpgfxClientContext*) e->pInterface; - pf_rdpgfx_pipeline_init(pc->gfx, ps->gfx, pc->pdata); - if (!ps->gfx->Open(ps->gfx)) { WLog_ERR(TAG, "failed to open GFX server"); return; } + + pc->gfx = (RdpgfxClientContext*) e->pInterface; + pf_rdpgfx_pipeline_init(pc->gfx, ps->gfx, pc->pdata); } else if (strcmp(e->name, DISP_DVC_CHANNEL_NAME) == 0) { - pc->disp = (DispClientContext*) e->pInterface; - pf_disp_register_callbacks(pc->disp, ps->disp, pc->pdata); - if (ps->disp->Open(ps->disp) != CHANNEL_RC_OK) { WLog_ERR(TAG, "failed to open disp channel"); return; } + + pc->disp = (DispClientContext*) e->pInterface; + pf_disp_register_callbacks(pc->disp, ps->disp, pc->pdata); } } @@ -108,11 +108,20 @@ void pf_OnChannelDisconnectedEventHandler(void* data, BOOL pf_server_channels_init(pServerContext* ps) { - if (!pf_server_rdpgfx_init(ps)) - return FALSE; + rdpContext* context = (rdpContext*) ps; + proxyConfig* config = ps->pdata->config; + + if (context->settings->SupportGraphicsPipeline && config->GFX) + { + if (!pf_server_rdpgfx_init(ps)) + return FALSE; + } - if (!pf_server_disp_init(ps)) - return FALSE; + if (config->DisplayControl) + { + if (!pf_server_disp_init(ps)) + return FALSE; + } return TRUE; } diff --git a/server/proxy/pf_server.c b/server/proxy/pf_server.c index f2c284a..961634a 100644 --- a/server/proxy/pf_server.c +++ b/server/proxy/pf_server.c @@ -245,9 +245,9 @@ static DWORD WINAPI pf_server_handle_client(LPVOID arg) goto out_free_peer; } - client->settings->SupportDisplayControl = TRUE; + client->settings->SupportDisplayControl = config->DisplayControl; + client->settings->DynamicResolutionUpdate = config->DisplayControl; client->settings->SupportMonitorLayoutPdu = TRUE; - client->settings->DynamicResolutionUpdate = TRUE; client->settings->RdpSecurity = config->RdpSecurity; client->settings->TlsSecurity = config->TlsSecurity; client->settings->NlaSecurity = config->NlaSecurity;