diff options
author | Giovanni panozzo <giovanni@panozzo.it> | 2020-05-21 15:28:56 +0300 |
---|---|---|
committer | Giovanni panozzo <giovanni@panozzo.it> | 2020-05-21 15:28:56 +0300 |
commit | 9c1683a357634035b4eef38e3ea8e6728c90a85f (patch) | |
tree | d70b953ce9a7a25e3b913b108a20bb128bc1bb7d /plugins/nx | |
parent | 7f1e16eabd3c142fcbc474d896b6cde731ac5bdd (diff) |
Introduce remmina_plugin_debug() for plugins
Diffstat (limited to 'plugins/nx')
-rw-r--r-- | plugins/nx/nx_plugin.c | 14 | ||||
-rw-r--r-- | plugins/nx/nx_plugin.h | 1 | ||||
-rw-r--r-- | plugins/nx/nx_session_manager.c | 2 |
3 files changed, 15 insertions, 2 deletions
diff --git a/plugins/nx/nx_plugin.c b/plugins/nx/nx_plugin.c index 025bb15f1..c7b38de23 100644 --- a/plugins/nx/nx_plugin.c +++ b/plugins/nx/nx_plugin.c @@ -36,6 +36,7 @@ #include <errno.h> #include <pthread.h> +#include <stdarg.h> #include "common/remmina_plugin.h" #include <gtk/gtkx.h> #include <time.h> @@ -307,6 +308,17 @@ static gint remmina_plugin_nx_wait_signal(RemminaPluginNxData *gpdata) return (gint)dummy; } +static void remmina_plugin_nx_log_callback(const gchar *fmt, ...) +{ + char buffer[256]; + va_list args; + va_start(args, fmt); + vsnprintf(buffer, sizeof(buffer), fmt, args); + remmina_plugin_debug(buffer); + va_end(args); +} + + static gboolean remmina_plugin_nx_start_session(RemminaProtocolWidget *gp) { TRACE_CALL(__func__); @@ -331,7 +343,7 @@ static gboolean remmina_plugin_nx_start_session(RemminaProtocolWidget *gp) remmina_nx_session_set_encryption(nx, remmina_plugin_nx_service->file_get_int(remminafile, "disableencryption", FALSE) ? 0 : 1); remmina_nx_session_set_localport(nx, remmina_plugin_nx_service->pref_get_sshtunnel_port()); - remmina_nx_session_set_log_callback(nx, remmina_plugin_nx_service->_debug); + remmina_nx_session_set_log_callback(nx, remmina_plugin_nx_log_callback); s2 = remmina_plugin_nx_service->protocol_plugin_start_direct_tunnel(gp, 22, FALSE); if (s2 == NULL) { diff --git a/plugins/nx/nx_plugin.h b/plugins/nx/nx_plugin.h index 3217ee6c5..84cce9792 100644 --- a/plugins/nx/nx_plugin.h +++ b/plugins/nx/nx_plugin.h @@ -76,5 +76,6 @@ typedef struct _RemminaPluginNxData { } RemminaPluginNxData; extern RemminaPluginService *remmina_plugin_nx_service; +#define remmina_plugin_debug(fmt, ...) remmina_plugin_nx_service->_remmina_debug(__func__, fmt __VA_OPT__(,) __VA_ARGS__) G_END_DECLS diff --git a/plugins/nx/nx_session_manager.c b/plugins/nx/nx_session_manager.c index 14cb4fb3e..f122cf0b0 100644 --- a/plugins/nx/nx_session_manager.c +++ b/plugins/nx/nx_session_manager.c @@ -113,7 +113,7 @@ void remmina_nx_session_manager_on_row_activated(GtkTreeView *tree, GtkTreePath { TRACE_CALL(__func__); RemminaPluginNxData *gpdata = GET_PLUGIN_DATA(gp); - remmina_plugin_nx_service->_debug("Default response_id %d", + remmina_plugin_debug("Default response_id %d", gpdata->default_response); if (gpdata->default_response >= 0) { |