GUACAMOLE-203: Change remaining instances of timer to timeout.

This commit is contained in:
Nick Couchman 2017-06-25 05:13:22 -04:00
parent 711cdd6929
commit 041fcc4651

View File

@ -323,8 +323,8 @@ void* ssh_client_thread(void* data) {
/* Track total amount of data read */ /* Track total amount of data read */
int total_read = 0; int total_read = 0;
/* Timer for polling socket activity */ /* Timeout for polling socket activity */
int timer; int timeout;
pthread_mutex_lock(&(ssh_client->term_channel_lock)); pthread_mutex_lock(&(ssh_client->term_channel_lock));
@ -336,14 +336,14 @@ void* ssh_client_thread(void* data) {
/* Send keepalive at configured interval */ /* Send keepalive at configured interval */
if (settings->server_alive_interval > 0) { if (settings->server_alive_interval > 0) {
int timeout = 0; timeout = 0;
if (libssh2_keepalive_send(ssh_client->session->session, &timeout) > 0) if (libssh2_keepalive_send(ssh_client->session->session, &timeout) > 0)
break; break;
timer = timeout * 1000; timeout *= 1000;
} }
/* If keepalive is not configured, sleep for the default of 1 second */ /* If keepalive is not configured, sleep for the default of 1 second */
else else
timer = GUAC_SSH_DEFAULT_POLL_TIMEOUT; timeout = GUAC_SSH_DEFAULT_POLL_TIMEOUT;
/* Read terminal data */ /* Read terminal data */
bytes_read = libssh2_channel_read(ssh_client->term_channel, bytes_read = libssh2_channel_read(ssh_client->term_channel,
@ -384,8 +384,8 @@ void* ssh_client_thread(void* data) {
.revents = 0, .revents = 0,
}}; }};
/* Wait up to computed timer */ /* Wait up to computed timeout */
if (poll(fds, 1, timer) < 0) if (poll(fds, 1, timeout) < 0)
break; break;
} }