GUACAMOLE-200: Move print job cleanup into main RDP client thread.
Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/bf2a5885 Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/bf2a5885 Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/bf2a5885 Branch: refs/heads/staging/0.9.12-incubating Commit: bf2a5885d05dca09ee4b8d73130e25e70d66a512 Parents: 5a68f93 Author: Michael Jumper <mjum...@apache.org> Authored: Tue Feb 14 00:09:24 2017 -0800 Committer: Michael Jumper <mjum...@apache.org> Committed: Tue Feb 14 00:09:24 2017 -0800 ---------------------------------------------------------------------- src/protocols/rdp/client.c | 7 ------- src/protocols/rdp/rdp.c | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/bf2a5885/src/protocols/rdp/client.c ---------------------------------------------------------------------- diff --git a/src/protocols/rdp/client.c b/src/protocols/rdp/client.c index 203bdb0..2dcb401 100644 --- a/src/protocols/rdp/client.c +++ b/src/protocols/rdp/client.c @@ -24,7 +24,6 @@ #include "rdp.h" #include "rdp_disp.h" #include "rdp_fs.h" -#include "rdp_print_job.h" #include "user.h" #ifdef ENABLE_COMMON_SSH @@ -107,12 +106,6 @@ int guac_rdp_client_free_handler(guac_client* client) { if (rdp_client->filesystem != NULL) guac_rdp_fs_free(rdp_client->filesystem); - /* Clean up print job, if active */ - if (rdp_client->active_job != NULL) { - guac_rdp_print_job_kill(rdp_client->active_job); - guac_rdp_print_job_free(rdp_client->active_job); - } - #ifdef ENABLE_COMMON_SSH /* Free SFTP filesystem, if loaded */ if (rdp_client->sftp_filesystem) http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/bf2a5885/src/protocols/rdp/rdp.c ---------------------------------------------------------------------- diff --git a/src/protocols/rdp/rdp.c b/src/protocols/rdp/rdp.c index 389c704..a48230a 100644 --- a/src/protocols/rdp/rdp.c +++ b/src/protocols/rdp/rdp.c @@ -31,6 +31,7 @@ #include "rdp_cliprdr.h" #include "rdp_disp.h" #include "rdp_fs.h" +#include "rdp_print_job.h" #include "rdp_gdi.h" #include "rdp_glyph.h" #include "rdp_pointer.h" @@ -853,6 +854,12 @@ static int guac_rdp_handle_connection(guac_client* client) { } + /* Clean up print job, if active */ + if (rdp_client->active_job != NULL) { + guac_rdp_print_job_kill(rdp_client->active_job); + guac_rdp_print_job_free(rdp_client->active_job); + } + pthread_mutex_lock(&(rdp_client->rdp_lock)); /* Disconnect client and channels */