From 7ed39ce724ecacf6016bd02cb6988a7f667ef81c Mon Sep 17 00:00:00 2001 From: kubistika Date: Sun, 8 Sep 2019 15:08:15 +0300 Subject: [PATCH] server: proxy: make sure module's pre connect only called once --- server/proxy/pf_client.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/proxy/pf_client.c b/server/proxy/pf_client.c index abde7f177..4cdf701ff 100644 --- a/server/proxy/pf_client.c +++ b/server/proxy/pf_client.c @@ -122,9 +122,6 @@ static BOOL pf_client_pre_connect(freerdp* instance) proxyConfig* config = ps->pdata->config; rdpSettings* settings = instance->settings; - if (!pf_modules_run_hook(HOOK_TYPE_CLIENT_PRE_CONNECT, (rdpContext*)ps)) - return FALSE; - /* * as the client's settings are copied from the server's, GlyphSupportLevel might not be * GLYPH_SUPPORT_NONE. the proxy currently do not support GDI & GLYPH_SUPPORT_CACHE, so @@ -266,11 +263,15 @@ static DWORD WINAPI pf_client_thread_proc(LPVOID arg) { freerdp* instance = (freerdp*)arg; pClientContext* pc = (pClientContext*)instance->context; + pServerContext* ps = pc->pdata->ps; proxyData* pdata = pc->pdata; DWORD nCount; DWORD status; HANDLE handles[65]; + if (!pf_modules_run_hook(HOOK_TYPE_CLIENT_PRE_CONNECT, (rdpContext*) ps)) + return FALSE; + /* * during redirection, freerdp's abort event might be overriden (reset) by the library, after * the server set it in order to shutdown the connection. it means that the server might signal