summaryrefslogtreecommitdiffstats
path: root/channels.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2018-07-27 12:03:17 +0000
committerDamien Miller <djm@mindrot.org>2018-07-31 12:20:13 +1000
commit5d14019ba2ff54acbfd20a6b9b96bb860a8c7c31 (patch)
treedfb3f5005c234e3e22c3cd5a2d2dc0adef734691 /channels.c
parente655ee04a3cb7999dbf9641b25192353e2b69418 (diff)
upstream: avoid expensive channel_open_message() calls; ok djm@
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/channels.c b/channels.c
index 1de63c21..e90f7fea 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.383 2018/07/11 18:53:29 markus Exp $ */
+/* $OpenBSD: channels.c,v 1.384 2018/07/27 12:03:17 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -608,9 +608,11 @@ channel_free(struct ssh *ssh, Channel *c)
if (c->type == SSH_CHANNEL_MUX_CLIENT)
mux_remove_remote_forwardings(ssh, c);
- s = channel_open_message(ssh);
- debug3("channel %d: status: %s", c->self, s);
- free(s);
+ if (log_level_get() >= SYSLOG_LEVEL_DEBUG3) {
+ s = channel_open_message(ssh);
+ debug3("channel %d: status: %s", c->self, s);
+ free(s);
+ }
channel_close_fds(ssh, c);
sshbuf_free(c->input);