1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -05:00

Server prep: support stderr output on channels.

The vtable method underneath sshfwd_write now takes an is_stderr
parameter, and in SSH-2, this is implemented by having separate stdout
and stderr bufchains in each outgoing channel, and counting the size
of both for the purposes of measuring backlog and so forth.

To avoid making _most_ call sites more verbose, the usual macro
wrapper hasn't changed its API; it just sets is_stderr=FALSE. To use
the new feature, there's an sshfwd_write_ext macro that exposes the
extra parameter.
This commit is contained in:
Simon Tatham
2018-10-20 21:41:28 +01:00
parent 61976b417e
commit 445030b3ea
5 changed files with 40 additions and 17 deletions

View File

@ -89,7 +89,8 @@ static const struct ConnectionLayerVtable ssh1_connlayer_vtable = {
ssh1_set_wants_user_input,
};
static int ssh1channel_write(SshChannel *c, const void *buf, int len);
static int ssh1channel_write(
SshChannel *c, int is_stderr, const void *buf, int len);
static void ssh1channel_write_eof(SshChannel *c);
static void ssh1channel_initiate_close(SshChannel *c, const char *err);
static void ssh1channel_unthrottle(SshChannel *c, int bufsize);
@ -581,7 +582,8 @@ static void ssh1channel_unthrottle(SshChannel *sc, int bufsize)
}
}
static int ssh1channel_write(SshChannel *sc, const void *buf, int len)
static int ssh1channel_write(
SshChannel *sc, int is_stderr, const void *buf, int len)
{
struct ssh1_channel *c = container_of(sc, struct ssh1_channel, sc);
struct ssh1_connection_state *s = c->connlayer;