Only read from agent if agent enabled.

This commit is contained in:
Michael Jumper 2013-12-03 09:21:47 -08:00
parent 9aed54d33a
commit 497996c48e

View File

@ -474,6 +474,7 @@ void* ssh_client_thread(void* data) {
total_read += bytes_read;
}
#ifdef ENABLE_SSH_AGENT
/* If agent open, handle any agent packets */
if (client_data->auth_agent != NULL) {
bytes_read = ssh_auth_agent_read(client_data->auth_agent);
@ -482,6 +483,7 @@ void* ssh_client_thread(void* data) {
else if (bytes_read < 0 && bytes_read != LIBSSH2_ERROR_EAGAIN)
client_data->auth_agent = NULL;
}
#endif
/* Wait for more data if reads turn up empty */
if (total_read == 0) {