Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/Remmina/Remmina.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiovanni panozzo <giovanni@panozzo.it>2020-05-21 15:28:56 +0300
committerGiovanni panozzo <giovanni@panozzo.it>2020-05-21 15:28:56 +0300
commit9c1683a357634035b4eef38e3ea8e6728c90a85f (patch)
treed70b953ce9a7a25e3b913b108a20bb128bc1bb7d /plugins/rdp
parent7f1e16eabd3c142fcbc474d896b6cde731ac5bdd (diff)
Introduce remmina_plugin_debug() for plugins
Diffstat (limited to 'plugins/rdp')
-rw-r--r--plugins/rdp/rdp_channels.c4
-rw-r--r--plugins/rdp/rdp_cliprdr.c20
-rw-r--r--plugins/rdp/rdp_event.c6
-rw-r--r--plugins/rdp/rdp_plugin.c54
-rw-r--r--plugins/rdp/rdp_plugin.h1
5 files changed, 43 insertions, 42 deletions
diff --git a/plugins/rdp/rdp_channels.c b/plugins/rdp/rdp_channels.c
index e2c145d17..09e58adfd 100644
--- a/plugins/rdp/rdp_channels.c
+++ b/plugins/rdp/rdp_channels.c
@@ -79,7 +79,7 @@ void remmina_rdp_OnChannelConnectedEventHandler(rdpContext* context, ChannelConn
if (rfi->scale == REMMINA_PROTOCOL_WIDGET_SCALE_MODE_DYNRES) {
remmina_rdp_event_send_delayed_monitor_layout(rfi->protocol_widget);
}
- }remmina_plugin_service->_debug("Channel %s has been opened", e->name);
+ }remmina_plugin_debug("Channel %s has been opened", e->name);
}
void remmina_rdp_OnChannelDisconnectedEventHandler(rdpContext* context, ChannelConnectedEventArgs* e)
@@ -91,6 +91,6 @@ void remmina_rdp_OnChannelDisconnectedEventHandler(rdpContext* context, ChannelC
if (rfi->settings->SoftwareGdi)
gdi_graphics_pipeline_uninit(context->gdi, (RdpgfxClientContext*) e->pInterface);
}
- remmina_plugin_service->_debug("Channel %s has been closed", e->name);
+ remmina_plugin_debug("Channel %s has been closed", e->name);
}
diff --git a/plugins/rdp/rdp_cliprdr.c b/plugins/rdp/rdp_cliprdr.c
index 2eeb72efd..80ced4701 100644
--- a/plugins/rdp/rdp_cliprdr.c
+++ b/plugins/rdp/rdp_cliprdr.c
@@ -239,7 +239,7 @@ static UINT remmina_rdp_cliprdr_server_format_list(CliprdrClientContext *context
gp = clipboard->rfi->protocol_widget;
GtkTargetList *list = gtk_target_list_new(NULL, 0);
- remmina_plugin_service->_debug("format list from the server:");
+ remmina_plugin_debug("format list from the server:");
for (i = 0; i < formatList->numFormats; i++) {
format = &formatList->formats[i];
serverFormatName = format->formatName;
@@ -280,7 +280,7 @@ static UINT remmina_rdp_cliprdr_server_format_list(CliprdrClientContext *context
} else if (format->formatId == CF_METAFILEPICT) {
serverFormatName = "CF_METAFILEPICT";
}
- remmina_plugin_service->_debug("the server has clipboard format %d: %s", format->formatId, serverFormatName);
+ remmina_plugin_debug("the server has clipboard format %d: %s", format->formatId, serverFormatName);
}
/* Keep only one DIB format, if present */
@@ -452,12 +452,12 @@ static UINT remmina_rdp_cliprdr_server_format_data_response(CliprdrClientContext
pthread_mutex_lock(&clipboard->transfer_clip_mutex);
pthread_cond_signal(&clipboard->transfer_clip_cond);
if (clipboard->srv_clip_data_wait == SCDW_BUSY_WAIT) {
- remmina_plugin_service->_debug("clibpoard transfer from server completed.");
+ remmina_plugin_debug("clibpoard transfer from server completed.");
clipboard->srv_data = output;
} else {
// Clipboard data arrived from server when we are not busywaiting on main loop
// Unfortunately, we must discard it
- remmina_plugin_service->_debug("clibpoard transfer from server completed. Data discarded due to abort or timeout.");
+ remmina_plugin_debug("clibpoard transfer from server completed. Data discarded due to abort or timeout.");
clipboard->srv_clip_data_wait = SCDW_NONE;
}
pthread_mutex_unlock(&clipboard->transfer_clip_mutex);
@@ -481,7 +481,7 @@ void remmina_rdp_cliprdr_request_data(GtkClipboard *gtkClipboard, GtkSelectionDa
int rc;
time_t tlimit;
- remmina_plugin_service->_debug("A local application has requested remote clipboard data for local format id %d", info);
+ remmina_plugin_debug("A local application has requested remote clipboard data for local format id %d", info);
clipboard = &(rfi->clipboard);
if (clipboard->srv_clip_data_wait != SCDW_NONE) {
@@ -500,7 +500,7 @@ void remmina_rdp_cliprdr_request_data(GtkClipboard *gtkClipboard, GtkSelectionDa
pFormatDataRequest->requestedFormatId = clipboard->format;
clipboard->srv_clip_data_wait = SCDW_BUSY_WAIT;
- remmina_plugin_service->_debug("Requesting clipboard data with fotmat %d from the server", clipboard->format);
+ remmina_plugin_debug("Requesting clipboard data with fotmat %d from the server", clipboard->format);
rdp_event.type = REMMINA_RDP_EVENT_TYPE_CLIPBOARD_SEND_CLIENT_FORMAT_DATA_REQUEST;
rdp_event.clipboard_formatdatarequest.pFormatDataRequest = pFormatDataRequest;
@@ -582,7 +582,7 @@ CLIPRDR_FORMAT_LIST *remmina_rdp_cliprdr_get_client_format_list(RemminaProtocolW
gtkClipboard = gtk_widget_get_clipboard(rfi->drawing_area, GDK_SELECTION_CLIPBOARD);
if (gtkClipboard)
result = gtk_clipboard_wait_for_targets(gtkClipboard, &targets, &loccount);
- remmina_plugin_service->_debug("Sending to server the following local clipboard content formats");
+ remmina_plugin_debug("Sending to server the following local clipboard content formats");
if (result && loccount > 0) {
formats = (CLIPRDR_FORMAT *)malloc(loccount * sizeof(CLIPRDR_FORMAT));
srvcount = 0;
@@ -590,7 +590,7 @@ CLIPRDR_FORMAT_LIST *remmina_rdp_cliprdr_get_client_format_list(RemminaProtocolW
formatId = remmina_rdp_cliprdr_get_format_from_gdkatom(targets[i]);
if (formatId != 0) {
name = gdk_atom_name(targets[i]);
- remmina_plugin_service->_debug(" local clipboard format %s will be sent to remote as %d", name, formatId);
+ remmina_plugin_debug(" local clipboard format %s will be sent to remote as %d", name, formatId);
g_free(name);
formats[srvcount].formatId = formatId;
formats[srvcount].formatName = NULL;
@@ -751,7 +751,7 @@ void remmina_rdp_cliprdr_set_clipboard_data(RemminaProtocolWidget *gp, RemminaPl
if (gtkClipboard) {
targets = gtk_target_table_new_from_list(ui->clipboard.targetlist, &n_targets);
if (targets) {
- remmina_plugin_service->_debug("setting clipboard with owner to owner %p", gp);
+ remmina_plugin_debug("setting clipboard with owner to owner %p", gp);
gtk_clipboard_set_with_owner(gtkClipboard, targets, n_targets,
(GtkClipboardGetFunc)remmina_rdp_cliprdr_request_data,
(GtkClipboardClearFunc)remmina_rdp_cliprdr_empty_clipboard, G_OBJECT(gp));
@@ -814,7 +814,7 @@ void remmina_rdp_clipboard_free(rfContext *rfi)
void remmina_rdp_clipboard_abort_transfer(rfContext *rfi)
{
if (rfi && rfi->clipboard.srv_clip_data_wait == SCDW_BUSY_WAIT) {
- remmina_plugin_service->_debug("requesting clipboard transfer to abort");
+ remmina_plugin_debug("requesting clipboard transfer to abort");
/* Allow clipboard transfer from server to terminate */
rfi->clipboard.srv_clip_data_wait = SCDW_ABORTING;
usleep(100000);
diff --git a/plugins/rdp/rdp_event.c b/plugins/rdp/rdp_event.c
index 2f4fe89a6..2126e15e2 100644
--- a/plugins/rdp/rdp_event.c
+++ b/plugins/rdp/rdp_event.c
@@ -717,7 +717,7 @@ gboolean remmina_rdp_event_on_clipboard(GtkClipboard *gtkClipboard, GdkEvent *ev
* after receivina a RDP server format list in remmina_rdp_cliprdr_server_format_list()
* In the latter case, we must ignore owner change */
- remmina_plugin_service->_debug("owner-change event received");
+ remmina_plugin_debug("owner-change event received");
rfContext *rfi = GET_PLUGIN_DATA(gp);
if (rfi)
@@ -726,7 +726,7 @@ gboolean remmina_rdp_event_on_clipboard(GtkClipboard *gtkClipboard, GdkEvent *ev
if (gtk_clipboard_get_owner(gtkClipboard) != (GObject*)gp) {
/* To do: avoid this when the new owner is another remmina protocol widget of
* the same remmina application */
- remmina_plugin_service->_debug(" new owner is different than me: new=%p me=%p. Sending local clipboard format list to server.",
+ remmina_plugin_debug(" new owner is different than me: new=%p me=%p. Sending local clipboard format list to server.",
gtk_clipboard_get_owner(gtkClipboard), (GObject*)gp);
pFormatList = remmina_rdp_cliprdr_get_client_format_list(gp);
@@ -734,7 +734,7 @@ gboolean remmina_rdp_event_on_clipboard(GtkClipboard *gtkClipboard, GdkEvent *ev
rdp_event.clipboard_formatlist.pFormatList = pFormatList;
remmina_rdp_event_event_push(gp, &rdp_event);
} else {
- remmina_plugin_service->_debug(" ... but I'm the owner!");
+ remmina_plugin_debug(" ... but I'm the owner!");
}
return TRUE;
}
diff --git a/plugins/rdp/rdp_plugin.c b/plugins/rdp/rdp_plugin.c
index 2fd62f58a..bd94a555f 100644
--- a/plugins/rdp/rdp_plugin.c
+++ b/plugins/rdp/rdp_plugin.c
@@ -190,14 +190,14 @@ static gboolean remmina_rdp_tunnel_init(RemminaProtocolWidget *gp)
gint port;
rfContext *rfi = GET_PLUGIN_DATA(gp);
- remmina_plugin_service->_debug("Tunnel init");
+ remmina_plugin_debug("Tunnel init");
hostport = remmina_plugin_service->protocol_plugin_start_direct_tunnel(gp, 3389, FALSE);
if (hostport == NULL)
return FALSE;
remmina_plugin_service->get_server_port(hostport, 3389, &host, &port);
- remmina_plugin_service->_debug("protocol_plugin_start_direct_tunnel() returned %s", hostport);
+ remmina_plugin_debug("protocol_plugin_start_direct_tunnel() returned %s", hostport);
cert_host = host;
cert_port = port;
@@ -217,7 +217,7 @@ static gboolean remmina_rdp_tunnel_init(RemminaProtocolWidget *gp)
}
}
- remmina_plugin_service->_debug("Tunnel has been optionally initialized. Now connecting to %s:%d", host, port);
+ remmina_plugin_debug("Tunnel has been optionally initialized. Now connecting to %s:%d", host, port);
if (cert_host != host) g_free(cert_host);
g_free(host);
@@ -254,7 +254,7 @@ BOOL rf_auto_reconnect(rfContext *rfi)
}
/* A network disconnect was detected and we should try to reconnect */
- remmina_plugin_service->_debug("[%s] network disconnection detected, initiating reconnection attempt",
+ remmina_plugin_debug("[%s] network disconnection detected, initiating reconnection attempt",
rfi->settings->ServerHostname);
ui = g_new0(RemminaPluginRdpUiObject, 1);
@@ -272,13 +272,13 @@ BOOL rf_auto_reconnect(rfContext *rfi)
while (TRUE) {
/* Quit retrying if max retries has been exceeded */
if (rfi->reconnect_nattempt++ >= rfi->reconnect_maxattempts) {
- remmina_plugin_service->_debug("[%s] maximum number of reconnection attempts exceeded.",
+ remmina_plugin_debug("[%s] maximum number of reconnection attempts exceeded.",
rfi->settings->ServerHostname);
break;
}
/* Attempt the next reconnect */
- remmina_plugin_service->_debug("[%s] reconnection, attempt #%d of %d",
+ remmina_plugin_debug("[%s] reconnection, attempt #%d of %d",
rfi->settings->ServerHostname, rfi->reconnect_nattempt, rfi->reconnect_maxattempts);
ui = g_new0(RemminaPluginRdpUiObject, 1);
@@ -289,12 +289,12 @@ BOOL rf_auto_reconnect(rfContext *rfi)
/* Reconnect the SSH tunnel, if needed */
if (!remmina_rdp_tunnel_init(rfi->protocol_widget)) {
- remmina_plugin_service->_debug("[%s] unable to recreate tunnel with remmina_rdp_tunnel_init.",
+ remmina_plugin_debug("[%s] unable to recreate tunnel with remmina_rdp_tunnel_init.",
rfi->settings->ServerHostname);
} else {
if (freerdp_reconnect(rfi->instance)) {
/* Reconnection is successful */
- remmina_plugin_service->_debug("[%s] reconnected.", rfi->settings->ServerHostname);
+ remmina_plugin_debug("[%s] reconnected.", rfi->settings->ServerHostname);
rfi->is_reconnecting = FALSE;
return TRUE;
}
@@ -786,7 +786,7 @@ static void remmina_rdp_main_loop(RemminaProtocolWidget *gp)
}
}
freerdp_disconnect(rfi->instance);
- remmina_plugin_service->_debug("RDP client disconnected");
+ remmina_plugin_debug("RDP client disconnected");
}
int remmina_rdp_load_static_channel_addin(rdpChannels *channels, rdpSettings *settings, char *name, void *data)
@@ -925,24 +925,24 @@ int remmina_rdp_set_printers(void *user_data, unsigned flags, cups_dest_t *dest)
printer = (RDPDR_PRINTER *)calloc(1, sizeof(RDPDR_PRINTER));
printer->Type = RDPDR_DTYP_PRINT;
- remmina_plugin_service->_debug("Printer Type: %d", printer->Type);
+ remmina_plugin_debug("Printer Type: %d", printer->Type);
rfi->settings->RedirectPrinters = TRUE;
remmina_rdp_load_static_channel_addin(channels, rfi->settings, "rdpdr", rfi->settings);
- remmina_plugin_service->_debug("Destination: %s", dest->name);
+ remmina_plugin_debug("Destination: %s", dest->name);
if (!(printer->Name = _strdup(dest->name))) {
free(printer);
return 1;
}
- remmina_plugin_service->_debug("Printer Name: %s", printer->Name);
+ remmina_plugin_debug("Printer Name: %s", printer->Name);
if (s) {
gchar *d = remmina_rdp_find_prdriver(strdup(s), printer->Name);
if (d) {
printer->DriverName = strdup(d);
- remmina_plugin_service->_debug("Printer DriverName set to: %s", printer->DriverName);
+ remmina_plugin_debug("Printer DriverName set to: %s", printer->DriverName);
g_free(d);
} else {
/**
@@ -960,7 +960,7 @@ int remmina_rdp_set_printers(void *user_data, unsigned flags, cups_dest_t *dest)
printer->DriverName = _strdup(model);
}
- remmina_plugin_service->_debug("Printer Driver: %s", printer->DriverName);
+ remmina_plugin_debug("Printer Driver: %s", printer->DriverName);
if (!freerdp_device_collection_add(rfi->settings, (RDPDR_DEVICE *)printer)) {
free(printer->DriverName);
free(printer->Name);
@@ -1010,7 +1010,7 @@ static gboolean remmina_rdp_main(RemminaProtocolWidget *gp)
#if defined(PROXY_TYPE_IGNORE)
if (!remmina_plugin_service->file_get_int(remminafile, "useproxyenv", FALSE) ? TRUE : FALSE) {
- remmina_plugin_service->_debug("Not using system proxy settings");
+ remmina_plugin_debug("Not using system proxy settings");
rfi->settings->ProxyType = PROXY_TYPE_IGNORE;
}
#endif
@@ -1098,11 +1098,11 @@ static gboolean remmina_rdp_main(RemminaProtocolWidget *gp)
gchar *proxy_password = g_strdup(remmina_plugin_service->file_get_string(remminafile, "proxy_password"));
gchar *proxy_hostname = g_strdup(remmina_plugin_service->file_get_string(remminafile, "proxy_hostname"));
gint proxy_port = remmina_plugin_service->file_get_int(remminafile, "proxy_port", 80);
- remmina_plugin_service->_debug("proxy_type: %s", proxy_type);
- remmina_plugin_service->_debug("proxy_username: %s", proxy_username);
- remmina_plugin_service->_debug("proxy_password: %s", proxy_password);
- remmina_plugin_service->_debug("proxy_hostname: %s", proxy_hostname);
- remmina_plugin_service->_debug("proxy_port: %d", proxy_port);
+ remmina_plugin_debug("proxy_type: %s", proxy_type);
+ remmina_plugin_debug("proxy_username: %s", proxy_username);
+ remmina_plugin_debug("proxy_password: %s", proxy_password);
+ remmina_plugin_debug("proxy_hostname: %s", proxy_hostname);
+ remmina_plugin_debug("proxy_port: %d", proxy_port);
if (proxy_type && proxy_hostname) {
if (g_strcmp0(proxy_type, "no_proxy") == 0)
rfi->settings->ProxyType = PROXY_TYPE_IGNORE;
@@ -1112,7 +1112,7 @@ static gboolean remmina_rdp_main(RemminaProtocolWidget *gp)
rfi->settings->ProxyType = PROXY_TYPE_SOCKS;
else
g_warning("Invalid proxy protocol, at the moment only no_proxy, HTTP and SOCKS5 are supported");
- remmina_plugin_service->_debug("ProxyType set to: %d", rfi->settings->ProxyType);
+ remmina_plugin_debug("ProxyType set to: %d", rfi->settings->ProxyType);
rfi->settings->ProxyHostname = proxy_hostname;
if (proxy_username)
rfi->settings->ProxyUsername = proxy_username;
@@ -1391,12 +1391,12 @@ static gboolean remmina_rdp_main(RemminaProtocolWidget *gp)
if (remmina_plugin_service->file_get_int(remminafile, "shareprinter", FALSE)) {
#ifdef HAVE_CUPS
- remmina_plugin_service->_debug("Sharing printers");
+ remmina_plugin_debug("Sharing printers");
if (cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0, remmina_rdp_set_printers, rfi))
- remmina_plugin_service->_debug("All printers have been shared");
+ remmina_plugin_debug("All printers have been shared");
else
- remmina_plugin_service->_debug("Cannot share printers, are there any available?");
+ remmina_plugin_debug("Cannot share printers, are there any available?");
#endif /* HAVE_CUPS */
}
@@ -1829,7 +1829,7 @@ static gboolean remmina_rdp_close_connection(RemminaProtocolWidget *gp)
if (rfi && rfi->clipboard.srv_clip_data_wait == SCDW_BUSY_WAIT) {
- remmina_plugin_service->_debug("[RDP] requesting clipboard transfer to abort");
+ remmina_plugin_debug("[RDP] requesting clipboard transfer to abort");
/* Allow clipboard transfer from server to terminate */
rfi->clipboard.srv_clip_data_wait = SCDW_ABORTING;
usleep(100000);
@@ -1920,10 +1920,10 @@ static gboolean remmina_rdp_get_screenshot(RemminaProtocolWidget *gp, RemminaPlu
szmem = gdi->width * gdi->height * bytesPerPixel;
- remmina_plugin_service->_debug("allocating %zu bytes for a full screenshot", szmem);
+ remmina_plugin_debug("allocating %zu bytes for a full screenshot", szmem);
rpsd->buffer = malloc(szmem);
if (!rpsd->buffer) {
- remmina_plugin_service->_debug("could not set aside %zu bytes for a full screenshot", szmem);
+ remmina_plugin_debug("could not set aside %zu bytes for a full screenshot", szmem);
return FALSE;
}
rpsd->width = gdi->width;
diff --git a/plugins/rdp/rdp_plugin.h b/plugins/rdp/rdp_plugin.h
index 7042f1835..7ffa02426 100644
--- a/plugins/rdp/rdp_plugin.h
+++ b/plugins/rdp/rdp_plugin.h
@@ -66,6 +66,7 @@ typedef struct rf_context rfContext;
#define DEFAULT_QUALITY_9 0x80
extern RemminaPluginService *remmina_plugin_service;
+#define remmina_plugin_debug(fmt, ...) remmina_plugin_service->_remmina_debug(__func__, fmt __VA_OPT__(,) __VA_ARGS__)
struct rf_clipboard {
rfContext * rfi;