From 4b1c8ec7ffe89493faf3a6a2cf5873a1fa023aeb Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 2 Mar 2014 10:09:32 -0800 Subject: [PATCH] Actually load guacsvc plugin for each static channel. --- src/protocols/rdp/client.c | 21 +++++++++++++++++---- src/protocols/rdp/guac_svc/svc_service.c | 4 ++-- src/protocols/rdp/rdp_svc.c | 14 +++++++++++--- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/protocols/rdp/client.c b/src/protocols/rdp/client.c index 0b9cbe5e..79f246a5 100644 --- a/src/protocols/rdp/client.c +++ b/src/protocols/rdp/client.c @@ -33,6 +33,7 @@ #include "rdp_glyph.h" #include "rdp_keymap.h" #include "rdp_pointer.h" +#include "rdp_svc.h" #include #include @@ -226,10 +227,22 @@ BOOL rdp_freerdp_pre_connect(freerdp* instance) { char** current = guac_client_data->settings.svc_names; do { - /* STUB */ - guac_client_log_info(client, - "STUB: Creating static channel \"%s\"...", - *current); + guac_rdp_svc* svc = guac_rdp_alloc_svc(client, *current); + + /* Attempt to load guacsvc plugin for new static channel */ + if (freerdp_channels_load_plugin(channels, instance->settings, + "guacsvc", svc)) { + guac_client_log_error(client, + "Failed to load guacsvc plugin for channel \"%s\".", + svc->name); + guac_rdp_free_svc(svc); + } + + /* Log success */ + else { + guac_client_log_info(client, "Created static channel \"%s\"...", + svc->name); + } } while (*(++current) != NULL); diff --git a/src/protocols/rdp/guac_svc/svc_service.c b/src/protocols/rdp/guac_svc/svc_service.c index ae3c6e55..863d1feb 100644 --- a/src/protocols/rdp/guac_svc/svc_service.c +++ b/src/protocols/rdp/guac_svc/svc_service.c @@ -103,11 +103,11 @@ void guac_svc_process_terminate(rdpSvcPlugin* plugin) { free(plugin); } -void guac_rdpdr_process_event(rdpSvcPlugin* plugin, wMessage* event) { +void guac_svc_process_event(rdpSvcPlugin* plugin, wMessage* event) { freerdp_event_free(event); } -void guac_rdpdr_process_receive(rdpSvcPlugin* plugin, +void guac_svc_process_receive(rdpSvcPlugin* plugin, wStream* input_stream) { /* STUB */ } diff --git a/src/protocols/rdp/rdp_svc.c b/src/protocols/rdp/rdp_svc.c index 91fbab2d..9580516d 100644 --- a/src/protocols/rdp/rdp_svc.c +++ b/src/protocols/rdp/rdp_svc.c @@ -33,12 +33,20 @@ #endif guac_rdp_svc* guac_rdp_alloc_svc(guac_client* client, char* name) { - /* STUB */ - return NULL; + + guac_rdp_svc* svc = malloc(sizeof(guac_rdp_svc)); + + svc->client = client; + svc->name = strdup(name); + svc->input_pipe = NULL; + svc->output_pipe = NULL; + + return svc; } void guac_rdp_free_svc(guac_rdp_svc* svc) { - /* STUB */ + free(svc->name); + free(svc); } void guac_rdp_add_svc(guac_client* client, guac_rdp_svc* svc) {