From e40173c290d6c23d55c202c2fc9e5103516547dd Mon Sep 17 00:00:00 2001 From: Brendan Shanks Date: Sun, 4 Nov 2018 22:11:10 -0800 Subject: [PATCH] Put more debug messages behind the 'trace' checkbox --- macssh/source/ssh/ssh2.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/macssh/source/ssh/ssh2.c b/macssh/source/ssh/ssh2.c index 7fc75aa..a10a1c7 100755 --- a/macssh/source/ssh/ssh2.c +++ b/macssh/source/ssh/ssh2.c @@ -1763,7 +1763,8 @@ void *ssh2_thread(WindRec*w) break; } else { - syslog(0, "select returned %d\n", rc); + if (w->trace) + syslog(0, "select returned %d\n", rc); } //if (FD_ISSET(stdoutfd, &writefds)) @@ -1775,7 +1776,8 @@ void *ssh2_thread(WindRec*w) while (1) { ssize_t bytes = libssh2_channel_read(channel, buf, sizeof(buf)); - syslog(0, "libssh2_channel_read() returned %d\n", bytes); + if (w->trace) + syslog(0, "libssh2_channel_read() returned %d\n", bytes); if (bytes > 0) WriteCharsToTTY(1, NULL, buf, bytes); else @@ -2083,7 +2085,8 @@ void ssh_packet_read(struct WindRec*w, unsigned char*databuf, short datalen) void ssh_protocol_write(struct WindRec*w, unsigned char*databuf, short datalen) { - syslog( 0, "### ssh_protocol_write, len : %d\n", datalen ); + if (w->trace) + syslog( 0, "### ssh_protocol_write, len : %d\n", datalen ); if (w->sshdata.thread) { LIBSSH2_CHANNEL *channel = (LIBSSH2_CHANNEL *)w->sshdata.channel;