GUACAMOLE-1115: Forcibly kill any outstanding PDF filter job when cleaning up resources.

This commit is contained in:
Michael Jumper 2022-03-17 18:27:05 +00:00
parent d734bac590
commit ce88fa4d4a
2 changed files with 12 additions and 0 deletions

View File

@ -199,6 +199,14 @@ int guac_rdp_client_free_handler(guac_client* client) {
if (rdp_client->filesystem != NULL) if (rdp_client->filesystem != NULL)
guac_rdp_fs_free(rdp_client->filesystem); guac_rdp_fs_free(rdp_client->filesystem);
/* End active print job, if any */
guac_rdp_print_job* job = (guac_rdp_print_job*) rdp_client->active_job;
if (job != NULL) {
guac_rdp_print_job_kill(job);
guac_rdp_print_job_free(job);
rdp_client->active_job = NULL;
}
#ifdef ENABLE_COMMON_SSH #ifdef ENABLE_COMMON_SSH
/* Free SFTP filesystem, if loaded */ /* Free SFTP filesystem, if loaded */
if (rdp_client->sftp_filesystem) if (rdp_client->sftp_filesystem)

View File

@ -28,6 +28,7 @@
#include <errno.h> #include <errno.h>
#include <pthread.h> #include <pthread.h>
#include <signal.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
@ -666,6 +667,9 @@ void guac_rdp_print_job_free(guac_rdp_print_job* job) {
void guac_rdp_print_job_kill(guac_rdp_print_job* job) { void guac_rdp_print_job_kill(guac_rdp_print_job* job) {
/* Forcibly kill filter process, if running */
kill(job->filter_pid, SIGKILL);
/* Stop all handling of I/O */ /* Stop all handling of I/O */
close(job->input_fd); close(job->input_fd);
close(job->output_fd); close(job->output_fd);