guacamole-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmuehl...@apache.org
Subject [17/26] incubator-guacamole-server git commit: GUACAMOLE-25: Support FreeRDP stable-1.0 and compatible.
Date Thu, 02 Jun 2016 18:45:24 GMT
GUACAMOLE-25: Support FreeRDP stable-1.0 and compatible.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/8ccf61e6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/8ccf61e6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/8ccf61e6

Branch: refs/heads/master
Commit: 8ccf61e6b1d9198b073b17f5bafe96e12ca65c06
Parents: f1d4393
Author: Michael Jumper <mjumper@apache.org>
Authored: Mon May 9 22:23:46 2016 -0700
Committer: Michael Jumper <mjumper@apache.org>
Committed: Wed May 25 13:50:29 2016 -0700

----------------------------------------------------------------------
 configure.ac                           |  9 ++++++++
 src/protocols/rdp/dvc.c                | 33 +++++++++++++++++++++++++++--
 src/protocols/rdp/guac_ai/ai_service.c |  6 ++++++
 3 files changed, 46 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/8ccf61e6/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 7dec629..446a36e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -579,6 +579,15 @@ then
         [#include <freerdp/channels/channels.h>])
 fi
 
+# Availability of ADDIN_ARGV structure for configuring plugins
+if test "x${have_freerdp}" = "xyes"
+then
+    AC_CHECK_TYPE([ADDIN_ARGV],
+        [AC_DEFINE([HAVE_ADDIN_ARGV],,
+                   [Whether the ADDIN_ARGV type is available])],,
+        [#include <freerdp/settings.h>])
+fi
+
 #
 # FreeRDP: WinPR
 #

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/8ccf61e6/src/protocols/rdp/dvc.c
----------------------------------------------------------------------
diff --git a/src/protocols/rdp/dvc.c b/src/protocols/rdp/dvc.c
index 0f0e835..10c65d7 100644
--- a/src/protocols/rdp/dvc.c
+++ b/src/protocols/rdp/dvc.c
@@ -117,6 +117,14 @@ int guac_rdp_load_drdynvc(rdpContext* context, guac_rdp_dvc_list* list)
{
     if (list->channel_count == 0)
         return 0;
 
+#ifndef HAVE_ADDIN_ARGV
+    /* Allocate plugin data array */
+    RDP_PLUGIN_DATA* all_plugin_data =
+        calloc(list->channel_count + 1, sizeof(RDP_PLUGIN_DATA));
+
+    RDP_PLUGIN_DATA* current_plugin_data = all_plugin_data;
+#endif
+
     /* For each channel */
     guac_common_list_element* current = list->channels->head;
     while (current != NULL) {
@@ -135,20 +143,41 @@ int guac_rdp_load_drdynvc(rdpContext* context, guac_rdp_dvc_list* list)
{
         guac_client_log(client, GUAC_LOG_DEBUG,
                 "Registering DVC plugin \"%s\"", dvc->argv[0]);
 
+#ifdef HAVE_ADDIN_ARGV
         /* Register plugin with FreeRDP */
         ADDIN_ARGV* args = malloc(sizeof(ADDIN_ARGV));
         args->argc = dvc->argc;
         args->argv = dvc->argv;
         freerdp_dynamic_channel_collection_add(context->settings, args);
+#else
+        /* Copy all arguments */
+        for (int i = 0; i < dvc->argc; i++)
+            current_plugin_data->data[i] = dvc->argv[i];
+
+        /* Store size of entry */
+        current_plugin_data->size = sizeof(*current_plugin_data);
+
+        /* Advance to next set of plugin data */
+        current_plugin_data++;
+#endif
 
         /* Rely on FreeRDP to free argv storage */
         dvc->argv = NULL;
 
     }
 
+#ifdef HAVE_ADDIN_ARGV
+    /* Load virtual channel management plugin */
+    return freerdp_channels_load_plugin(channels, context->instance->settings,
+                "drdynvc", context->instance->settings);
+#else
+    /* Terminate with empty RDP_PLUGIN_DATA element */
+    current_plugin_data->size = 0;
+
     /* Load virtual channel management plugin */
-    return freerdp_channels_load_plugin(channels, context->settings,
-                "drdynvc", context->settings);
+    return freerdp_channels_load_plugin(channels, context->instance->settings,
+                "drdynvc", all_plugin_data);
+#endif
 
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/8ccf61e6/src/protocols/rdp/guac_ai/ai_service.c
----------------------------------------------------------------------
diff --git a/src/protocols/rdp/guac_ai/ai_service.c b/src/protocols/rdp/guac_ai/ai_service.c
index 2fbf2ac..5058ea0 100644
--- a/src/protocols/rdp/guac_ai/ai_service.c
+++ b/src/protocols/rdp/guac_ai/ai_service.c
@@ -314,8 +314,14 @@ static int guac_rdp_ai_terminated(IWTSPlugin* plugin) {
  */
 int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) {
 
+    /* Pull guac_client from arguments */
+#ifdef HAVE_ADDIN_ARGV
     ADDIN_ARGV* args = pEntryPoints->GetPluginData(pEntryPoints);
     guac_client* client = (guac_client*) guac_rdp_string_to_ptr(args->argv[1]);
+#else
+    RDP_PLUGIN_DATA* data = pEntryPoints->GetPluginData(pEntryPoints);
+    guac_client* client = (guac_client*) guac_rdp_string_to_ptr(data->data[1]);
+#endif
 
     /* Pull previously-allocated plugin */
     guac_rdp_ai_plugin* ai_plugin = (guac_rdp_ai_plugin*)


Mime
View raw message