channels: cliprdr: server: add autoInitializationSequence
authorkubistika <kmizrachi18@gmail.com>
Sun, 4 Aug 2019 14:37:56 +0000 (17:37 +0300)
committerakallabeth <akallabeth@users.noreply.github.com>
Mon, 19 Aug 2019 07:30:40 +0000 (09:30 +0200)
channels/cliprdr/server/cliprdr_main.c
include/freerdp/server/cliprdr.h

index 1100099..43202ee 100644 (file)
@@ -1356,10 +1356,13 @@ static DWORD WINAPI cliprdr_server_thread(LPVOID arg)
        events[nCount++] = cliprdr->StopEvent;
        events[nCount++] = ChannelEvent;
 
-       if ((error = cliprdr_server_init(context)))
+       if (context->autoInitializationSequence)
        {
-               WLog_ERR(TAG, "cliprdr_server_init failed with error %"PRIu32"!", error);
-               goto out;
+               if ((error = cliprdr_server_init(context)))
+               {
+                       WLog_ERR(TAG, "cliprdr_server_init failed with error %"PRIu32"!", error);
+                       goto out;
+               }
        }
 
        while (1)
@@ -1566,6 +1569,7 @@ CliprdrServerContext* cliprdr_server_context_new(HANDLE vcm)
 
        if (context)
        {
+               context->autoInitializationSequence = TRUE;
                context->Open = cliprdr_server_open;
                context->Close = cliprdr_server_close;
                context->Start = cliprdr_server_start;
index 440b8af..0bdd260 100644 (file)
@@ -103,6 +103,7 @@ struct _cliprdr_server_context
        psCliprdrServerFileContentsResponse ServerFileContentsResponse;
 
        rdpContext* rdpcontext;
+       BOOL autoInitializationSequence;
        UINT32 lastRequestedFormatId;
 };