GUACAMOLE-203: Warn user if they try to enter keepalive value < 2 seconds.

This commit is contained in:
Nick Couchman 2017-05-31 19:47:09 -04:00 committed by Nick Couchman
parent 1e3d82cc63
commit 9993684205
2 changed files with 5 additions and 2 deletions

View File

@ -291,6 +291,9 @@ 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;

View File

@ -225,7 +225,7 @@ void* ssh_client_thread(void* data) {
}
/* Set keepalive configuration for session */
if (settings->server_alive_interval > 1)
if (settings->server_alive_interval > 0)
libssh2_keepalive_config(ssh_client->session->session, 1, settings->server_alive_interval);
pthread_mutex_init(&ssh_client->term_channel_lock, NULL);
@ -339,7 +339,7 @@ void* ssh_client_thread(void* data) {
}
/* Send keepalive at configured interval */
if (settings->server_alive_interval > 1) {
if (settings->server_alive_interval > 0) {
int timeout = 0;
if(libssh2_keepalive_send(ssh_client->session->session, &timeout) > 0)
break;