1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Give SshChannel a pointer to its owning ConnectionLayer.

In my future plans, some SshChannels are going to need to be able to
ask favours from the connection layer as a whole. And an SshChannel is
inextricably tied to an instance of the connection layer, so there's
no real reason _not_ to make the pointer generally available.
This commit is contained in:
Simon Tatham 2018-10-14 17:17:48 +01:00
parent d1cd8b2591
commit 8db76dc3d7
3 changed files with 3 additions and 0 deletions

View File

@ -950,6 +950,7 @@ static void ssh1_channel_init(struct ssh1_channel *c)
c->pending_eof = FALSE;
c->throttling_conn = FALSE;
c->sc.vt = &ssh1channel_vtable;
c->sc.cl = &s->cl;
c->localid = alloc_channel_id(s->channels, struct ssh1_channel);
add234(s->channels, c);
}

View File

@ -1348,6 +1348,7 @@ static void ssh2_channel_init(struct ssh2_channel *c)
c->throttle_state = UNTHROTTLED;
bufchain_init(&c->outbuffer);
c->sc.vt = &ssh2channel_vtable;
c->sc.cl = &s->cl;
c->localid = alloc_channel_id(s->channels, struct ssh2_channel);
add234(s->channels, c);
}

View File

@ -157,6 +157,7 @@ struct SshChannelVtable {
struct SshChannel {
const struct SshChannelVtable *vt;
ConnectionLayer *cl;
};
#define sshfwd_write(c, buf, len) ((c)->vt->write(c, buf, len))