mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-28 16:24:39 +02:00
upstream: avoid expensive channel_open_message() calls; ok djm@
OpenBSD-Commit-ID: aea3b5512ad681cd8710367d743e8a753d4425d9
This commit is contained in:
parent
e655ee04a3
commit
5d14019ba2
@ -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>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* 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)
|
if (c->type == SSH_CHANNEL_MUX_CLIENT)
|
||||||
mux_remove_remote_forwardings(ssh, c);
|
mux_remove_remote_forwardings(ssh, c);
|
||||||
|
|
||||||
|
if (log_level_get() >= SYSLOG_LEVEL_DEBUG3) {
|
||||||
s = channel_open_message(ssh);
|
s = channel_open_message(ssh);
|
||||||
debug3("channel %d: status: %s", c->self, s);
|
debug3("channel %d: status: %s", c->self, s);
|
||||||
free(s);
|
free(s);
|
||||||
|
}
|
||||||
|
|
||||||
channel_close_fds(ssh, c);
|
channel_close_fds(ssh, c);
|
||||||
sshbuf_free(c->input);
|
sshbuf_free(c->input);
|
||||||
|
8
log.c
8
log.c
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: log.c,v 1.50 2017/05/17 01:24:17 djm Exp $ */
|
/* $OpenBSD: log.c,v 1.51 2018/07/27 12:03:17 markus Exp $ */
|
||||||
/*
|
/*
|
||||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||||
@ -105,6 +105,12 @@ static struct {
|
|||||||
{ NULL, SYSLOG_LEVEL_NOT_SET }
|
{ NULL, SYSLOG_LEVEL_NOT_SET }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
LogLevel
|
||||||
|
log_level_get(void)
|
||||||
|
{
|
||||||
|
return log_level;
|
||||||
|
}
|
||||||
|
|
||||||
SyslogFacility
|
SyslogFacility
|
||||||
log_facility_number(char *name)
|
log_facility_number(char *name)
|
||||||
{
|
{
|
||||||
|
3
log.h
3
log.h
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: log.h,v 1.22 2017/05/17 01:24:17 djm Exp $ */
|
/* $OpenBSD: log.h,v 1.23 2018/07/27 12:03:17 markus Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
@ -49,6 +49,7 @@ typedef enum {
|
|||||||
typedef void (log_handler_fn)(LogLevel, const char *, void *);
|
typedef void (log_handler_fn)(LogLevel, const char *, void *);
|
||||||
|
|
||||||
void log_init(char *, LogLevel, SyslogFacility, int);
|
void log_init(char *, LogLevel, SyslogFacility, int);
|
||||||
|
LogLevel log_level_get(void);
|
||||||
int log_change_level(LogLevel);
|
int log_change_level(LogLevel);
|
||||||
int log_is_on_stderr(void);
|
int log_is_on_stderr(void);
|
||||||
void log_redirect_stderr_to(const char *);
|
void log_redirect_stderr_to(const char *);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user