From af4d76214773187da5d93241c88dac05148502eb Mon Sep 17 00:00:00 2001 From: Nick Couchman Date: Wed, 14 Jun 2017 12:49:49 -0400 Subject: [PATCH] GUACAMOLE-203: Move warning about minimum alive interval to single place in common code. --- src/common-ssh/ssh.c | 6 ++++++ src/protocols/rdp/rdp_settings.c | 3 --- src/protocols/ssh/settings.c | 3 --- src/protocols/vnc/settings.c | 3 --- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/common-ssh/ssh.c b/src/common-ssh/ssh.c index 3bff4b39..00f6327a 100644 --- a/src/common-ssh/ssh.c +++ b/src/common-ssh/ssh.c @@ -536,6 +536,12 @@ guac_common_ssh_session* guac_common_ssh_create_session(guac_client* client, if (keepalive > 0) libssh2_keepalive_config(common_session->session, 1, keepalive); + /* Warn if keepalive below minimum value */ + if (keepalive == 1) { + guac_user_log(user, GUAC_LOG_WARNING, "keepalive interval will " + "be rounded up to minimum value of 2."); + } + /* Return created session */ return common_session; diff --git a/src/protocols/rdp/rdp_settings.c b/src/protocols/rdp/rdp_settings.c index eebf9028..f73ef9d9 100644 --- a/src/protocols/rdp/rdp_settings.c +++ b/src/protocols/rdp/rdp_settings.c @@ -788,9 +788,6 @@ guac_rdp_settings* guac_rdp_parse_args(guac_user* user, settings->sftp_server_alive_interval = guac_user_parse_args_int(user, GUAC_RDP_CLIENT_ARGS, argv, IDX_SFTP_SERVER_ALIVE_INTERVAL, 0); - if (settings->sftp_server_alive_interval == 1) - guac_user_log(user, GUAC_LOG_WARNING, "The minimum allowed " - "value for keepalives is 2 seconds, this will be rounded up."); #endif /* Read recording path */ diff --git a/src/protocols/ssh/settings.c b/src/protocols/ssh/settings.c index 98594153..8843923b 100644 --- a/src/protocols/ssh/settings.c +++ b/src/protocols/ssh/settings.c @@ -291,9 +291,6 @@ guac_ssh_settings* guac_ssh_parse_args(guac_user* user, settings->server_alive_interval = guac_user_parse_args_int(user, GUAC_SSH_CLIENT_ARGS, argv, IDX_SERVER_ALIVE_INTERVAL, 0); - if (settings->server_alive_interval == 1) - guac_user_log(user, GUAC_LOG_WARNING, "Minimum keepalive interval " - " for libssh2 is 2 seconds."); /* Parsing was successful */ return settings; diff --git a/src/protocols/vnc/settings.c b/src/protocols/vnc/settings.c index cf1d8bca..697466df 100644 --- a/src/protocols/vnc/settings.c +++ b/src/protocols/vnc/settings.c @@ -409,9 +409,6 @@ guac_vnc_settings* guac_vnc_parse_args(guac_user* user, settings->sftp_server_alive_interval = guac_user_parse_args_int(user, GUAC_VNC_CLIENT_ARGS, argv, IDX_SFTP_SERVER_ALIVE_INTERVAL, 0); - if (settings->sftp_server_alive_interval == 1) - guac_user_log(user, GUAC_LOG_WARNING, "The minimum allowed " - "value for keepalives is 2 seconds."); #endif /* Read recording path */