Fixed usage of freerdp funcs (now return boolean), added debug logging.

This commit is contained in:
Michael Jumper 2012-01-03 13:20:24 -08:00
parent 04625d4492
commit 1042225ef5
2 changed files with 24 additions and 7 deletions

View File

@ -79,13 +79,13 @@ int rdp_guac_client_handle_messages(guac_client* client) {
fd_set rfds, wfds;
/* get rdp fds */
if (freerdp_get_fds(rdp_inst, read_fds, &read_count, write_fds, &write_count) != 0) {
if (!freerdp_get_fds(rdp_inst, read_fds, &read_count, write_fds, &write_count)) {
guac_client_log_error(client, "Unable to read RDP file descriptors.");
return 1;
}
/* get channel fds */
if (freerdp_channels_get_fds(channels, rdp_inst, read_fds, &read_count, write_fds, &write_count) != 0) {
if (!freerdp_channels_get_fds(channels, rdp_inst, read_fds, &read_count, write_fds, &write_count)) {
guac_client_log_error(client, "Unable to read RDP channel file descriptors.");
return 1;
}
@ -128,14 +128,14 @@ int rdp_guac_client_handle_messages(guac_client* client) {
}
}
/* check the libfreerdp fds */
if (freerdp_check_fds(rdp_inst) != 0) {
/* Check the libfreerdp fds */
if (!freerdp_check_fds(rdp_inst)) {
guac_client_log_error(client, "Error handling RDP file descriptors.");
return 1;
}
/* check channel fds */
if (freerdp_channels_check_fds(channels, rdp_inst) != 0) {
/* Check channel fds */
if (!freerdp_channels_check_fds(channels, rdp_inst)) {
guac_client_log_error(client, "Error handling RDP channel file descriptors.");
return 1;
}

View File

@ -93,14 +93,31 @@ void guac_rdp_bitmap_new(rdpContext* context, rdpBitmap* bitmap) {
/* Store buffer reference in bitmap */
((guac_rdp_bitmap*) bitmap)->layer = buffer;
guac_client_log_info(client, "guac_rdp_bitmap_new()");
}
void guac_rdp_bitmap_paint(rdpContext* context, rdpBitmap* bitmap) {
/* STUB */
guac_client* client = ((rdp_freerdp_context*) context)->client;
guac_socket* socket = client->socket;
/* Copy image data from buffer to visible layer */
guac_protocol_send_copy(socket,
((guac_rdp_bitmap*) bitmap)->layer,
0, 0, bitmap->width, bitmap->height,
GUAC_COMP_OVER,
GUAC_DEFAULT_LAYER, bitmap->left, bitmap->top);
guac_client_log_info(client, "guac_rdp_bitmap_paint()");
}
void guac_rdp_bitmap_free(rdpContext* context, rdpBitmap* bitmap) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
guac_client_free_buffer(client, ((guac_rdp_bitmap*) bitmap)->layer);
guac_client_log_info(client, "guac_rdp_bitmap_free()");
}