diff options
author | markus@openbsd.org <markus@openbsd.org> | 2018-07-27 12:03:17 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2018-07-31 12:20:13 +1000 |
commit | 5d14019ba2ff54acbfd20a6b9b96bb860a8c7c31 (patch) | |
tree | dfb3f5005c234e3e22c3cd5a2d2dc0adef734691 /channels.c | |
parent | e655ee04a3cb7999dbf9641b25192353e2b69418 (diff) |
upstream: avoid expensive channel_open_message() calls; ok djm@
OpenBSD-Commit-ID: aea3b5512ad681cd8710367d743e8a753d4425d9
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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); |