From 2d885fdec22efae4505710fc40625328dfde59f0 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 2 Mar 2014 11:12:27 -0800 Subject: [PATCH] Send any received data to pipe. --- src/protocols/rdp/compat/winpr-stream.h | 1 + src/protocols/rdp/guac_svc/svc_service.c | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/protocols/rdp/compat/winpr-stream.h b/src/protocols/rdp/compat/winpr-stream.h index 163cbc16..ffe5c1d8 100644 --- a/src/protocols/rdp/compat/winpr-stream.h +++ b/src/protocols/rdp/compat/winpr-stream.h @@ -60,6 +60,7 @@ #define Stream_SetPointer stream_set_mark #define Stream_Buffer stream_get_head #define Stream_Pointer stream_get_tail +#define Stream_Length stream_get_length #define wStream STREAM #define wMessage RDP_EVENT diff --git a/src/protocols/rdp/guac_svc/svc_service.c b/src/protocols/rdp/guac_svc/svc_service.c index a54c1e3a..39997724 100644 --- a/src/protocols/rdp/guac_svc/svc_service.c +++ b/src/protocols/rdp/guac_svc/svc_service.c @@ -115,6 +115,23 @@ void guac_svc_process_event(rdpSvcPlugin* plugin, wMessage* event) { void guac_svc_process_receive(rdpSvcPlugin* plugin, wStream* input_stream) { - /* STUB */ + + /* Get corresponding guac_rdp_svc */ + guac_svcPlugin* svc_plugin = (guac_svcPlugin*) plugin; + guac_rdp_svc* svc = svc_plugin->svc; + + /* Fail if output not created */ + if (svc->output_pipe == NULL) { + guac_client_log_error(svc->client, + "Output for channel \"%s\" dropped.", + svc->name); + return; + } + + /* Send blob */ + guac_protocol_send_blob(svc->client->socket, svc->output_pipe, + Stream_Buffer(input_stream), + Stream_Length(input_stream)); + }