GUACAMOLE-203: Deal correctly with negative keepalive values.
This commit is contained in:
parent
ed77114038
commit
05dfb1a6ae
@ -532,16 +532,20 @@ guac_common_ssh_session* guac_common_ssh_create_session(guac_client* client,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Configure session keepalive */
|
|
||||||
if (keepalive > 0)
|
|
||||||
libssh2_keepalive_config(common_session->session, 1, keepalive);
|
|
||||||
|
|
||||||
/* Warn if keepalive below minimum value */
|
/* Warn if keepalive below minimum value */
|
||||||
if (keepalive == 1) {
|
if (keepalive < 0) {
|
||||||
|
keepalive = 0;
|
||||||
|
guac_client_log(client, GUAC_LOG_WARNING, "negative keepalive intervals "
|
||||||
|
"are converted to 0, disabling keepalive.");
|
||||||
|
}
|
||||||
|
else if(keepalive == 1) {
|
||||||
guac_client_log(client, GUAC_LOG_WARNING, "keepalive interval will "
|
guac_client_log(client, GUAC_LOG_WARNING, "keepalive interval will "
|
||||||
"be rounded up to minimum value of 2.");
|
"be rounded up to minimum value of 2.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Configure session keepalive */
|
||||||
|
libssh2_keepalive_config(common_session->session, 1, keepalive);
|
||||||
|
|
||||||
/* Return created session */
|
/* Return created session */
|
||||||
return common_session;
|
return common_session;
|
||||||
|
|
||||||
|
@ -366,7 +366,7 @@ typedef struct guac_rdp_settings {
|
|||||||
* of 1 is automatically increased to 2 by libssh2 to avoid busy loop corner
|
* of 1 is automatically increased to 2 by libssh2 to avoid busy loop corner
|
||||||
* cases.
|
* cases.
|
||||||
*/
|
*/
|
||||||
unsigned sftp_server_alive_interval;
|
int sftp_server_alive_interval;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -189,7 +189,7 @@ typedef struct guac_ssh_settings {
|
|||||||
/**
|
/**
|
||||||
* The number of seconds between sending server alive messages.
|
* The number of seconds between sending server alive messages.
|
||||||
*/
|
*/
|
||||||
unsigned server_alive_interval;
|
int server_alive_interval;
|
||||||
|
|
||||||
} guac_ssh_settings;
|
} guac_ssh_settings;
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ typedef struct guac_vnc_settings {
|
|||||||
* of 1 is automatically increased to 2 by libssh2 to avoid busy loop corner
|
* of 1 is automatically increased to 2 by libssh2 to avoid busy loop corner
|
||||||
* cases.
|
* cases.
|
||||||
*/
|
*/
|
||||||
unsigned sftp_server_alive_interval;
|
int sftp_server_alive_interval;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user