mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 06:38:37 -05:00
SSH proxy: separate stdout from stderr.
In the initial version of SSH proxying that only opened direct-tcpip channels, this wasn't important. But as of commit 6f7c52dccee36f6, we now support invoking a command or subsystem on the proxy SSH server, and those _can_ generate stderr data which we must now separate from stdout. Happily, we have a perfectly sensible thing to _do_ with it: the same thing we'd do with stderr coming from a local proxy subprocess, to wit, pass it to log_proxy_stderr so that it can appear in the terminal window (if configured to) and the Event Log.
This commit is contained in:
parent
e22df74545
commit
a2ac5ec287
@ -255,8 +255,15 @@ static size_t sshproxy_output(Seat *seat, SeatOutputType type,
|
|||||||
const void *data, size_t len)
|
const void *data, size_t len)
|
||||||
{
|
{
|
||||||
SshProxy *sp = container_of(seat, SshProxy, seat);
|
SshProxy *sp = container_of(seat, SshProxy, seat);
|
||||||
bufchain_add(&sp->ssh_to_socket, data, len);
|
switch (type) {
|
||||||
try_send_ssh_to_socket(sp);
|
case SEAT_OUTPUT_STDOUT:
|
||||||
|
bufchain_add(&sp->ssh_to_socket, data, len);
|
||||||
|
try_send_ssh_to_socket(sp);
|
||||||
|
break;
|
||||||
|
case SEAT_OUTPUT_STDERR:
|
||||||
|
log_proxy_stderr(sp->plug, &sp->psb, data, len);
|
||||||
|
break;
|
||||||
|
}
|
||||||
return bufchain_size(&sp->ssh_to_socket);
|
return bufchain_size(&sp->ssh_to_socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user