GUACAMOLE-203: Warn user if they try to enter keepalive value < 2 seconds.
This commit is contained in:
parent
1e3d82cc63
commit
9993684205
@ -291,6 +291,9 @@ guac_ssh_settings* guac_ssh_parse_args(guac_user* user,
|
|||||||
settings->server_alive_interval =
|
settings->server_alive_interval =
|
||||||
guac_user_parse_args_int(user, GUAC_SSH_CLIENT_ARGS, argv,
|
guac_user_parse_args_int(user, GUAC_SSH_CLIENT_ARGS, argv,
|
||||||
IDX_SERVER_ALIVE_INTERVAL, 0);
|
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 */
|
/* Parsing was successful */
|
||||||
return settings;
|
return settings;
|
||||||
|
@ -225,7 +225,7 @@ void* ssh_client_thread(void* data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set keepalive configuration for session */
|
/* 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);
|
libssh2_keepalive_config(ssh_client->session->session, 1, settings->server_alive_interval);
|
||||||
|
|
||||||
pthread_mutex_init(&ssh_client->term_channel_lock, NULL);
|
pthread_mutex_init(&ssh_client->term_channel_lock, NULL);
|
||||||
@ -339,7 +339,7 @@ void* ssh_client_thread(void* data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Send keepalive at configured interval */
|
/* Send keepalive at configured interval */
|
||||||
if (settings->server_alive_interval > 1) {
|
if (settings->server_alive_interval > 0) {
|
||||||
int timeout = 0;
|
int timeout = 0;
|
||||||
if(libssh2_keepalive_send(ssh_client->session->session, &timeout) > 0)
|
if(libssh2_keepalive_send(ssh_client->session->session, &timeout) > 0)
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user