server: proxy: client: before loading client addins, wait for serve's dynvc to be...
authorkubistika <kmizrachi18@gmail.com>
Tue, 6 Aug 2019 08:49:04 +0000 (11:49 +0300)
committerakallabeth <akallabeth@users.noreply.github.com>
Tue, 13 Aug 2019 14:28:05 +0000 (16:28 +0200)
server/proxy/pf_client.c
server/proxy/pf_rdpgfx.c

index 9986764..a83f89e 100644 (file)
@@ -90,6 +90,8 @@ static void pf_OnErrorInfo(void* ctx, ErrorInfoEventArgs* e)
  */
 static BOOL pf_client_pre_connect(freerdp* instance)
 {
+       pClientContext* pc = (pClientContext*) instance->context;
+       pServerContext* ps = pc->pdata->ps;
        rdpSettings* settings = instance->settings;
 
        /*
@@ -98,7 +100,6 @@ static BOOL pf_client_pre_connect(freerdp* instance)
         * GlyphCacheSupport must be explicitly set to GLYPH_SUPPORT_NONE.
         */
        settings->GlyphSupportLevel = GLYPH_SUPPORT_NONE;
-
        settings->OsMajorType = OSMAJORTYPE_UNIX;
        settings->OsMinorType = OSMINORTYPE_NATIVE_XSERVER;
        /**
@@ -119,6 +120,11 @@ static BOOL pf_client_pre_connect(freerdp* instance)
        PubSub_SubscribeChannelDisconnected(instance->context->pubSub,
                                            pf_OnChannelDisconnectedEventHandler);
        PubSub_SubscribeErrorInfo(instance->context->pubSub, pf_OnErrorInfo);
+
+       /* before loading client's channels, make sure proxy's dynvc is ready */
+       WLog_DBG(TAG, "pf_client_pre_connect(): Waiting for proxy's server dynvc to be ready");
+       WaitForSingleObject(ps->dynvcReady, INFINITE);
+
        /**
         * Load all required plugins / channels / libraries specified by current
         * settings.
index de885d1..74d11e8 100644 (file)
@@ -201,7 +201,6 @@ static UINT pf_rdpgfx_map_surface_to_scaled_output(RdpgfxClientContext* context,
 static UINT pf_rdpgfx_on_open(RdpgfxClientContext* context,
                               BOOL* do_caps_advertise, BOOL* send_frame_acks)
 {
-       proxyData* pdata = (proxyData*) context->custom;
        WLog_VRB(TAG, __FUNCTION__);
 
        if (NULL != do_caps_advertise)
@@ -210,10 +209,6 @@ static UINT pf_rdpgfx_on_open(RdpgfxClientContext* context,
        if (NULL != send_frame_acks)
                *send_frame_acks = FALSE;
 
-       /* Wait for the proxy's server's DYNVC to be in a ready state to safely open
-        * the GFX DYNVC. */
-       WLog_DBG(TAG, "Waiting for proxy's server dynvc to be ready");
-       WaitForSingleObject(pdata->ps->dynvcReady, INFINITE);
        return CHANNEL_RC_OK;
 }