mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +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:
parent
d1cd8b2591
commit
8db76dc3d7
@ -950,6 +950,7 @@ static void ssh1_channel_init(struct ssh1_channel *c)
|
|||||||
c->pending_eof = FALSE;
|
c->pending_eof = FALSE;
|
||||||
c->throttling_conn = FALSE;
|
c->throttling_conn = FALSE;
|
||||||
c->sc.vt = &ssh1channel_vtable;
|
c->sc.vt = &ssh1channel_vtable;
|
||||||
|
c->sc.cl = &s->cl;
|
||||||
c->localid = alloc_channel_id(s->channels, struct ssh1_channel);
|
c->localid = alloc_channel_id(s->channels, struct ssh1_channel);
|
||||||
add234(s->channels, c);
|
add234(s->channels, c);
|
||||||
}
|
}
|
||||||
|
@ -1348,6 +1348,7 @@ static void ssh2_channel_init(struct ssh2_channel *c)
|
|||||||
c->throttle_state = UNTHROTTLED;
|
c->throttle_state = UNTHROTTLED;
|
||||||
bufchain_init(&c->outbuffer);
|
bufchain_init(&c->outbuffer);
|
||||||
c->sc.vt = &ssh2channel_vtable;
|
c->sc.vt = &ssh2channel_vtable;
|
||||||
|
c->sc.cl = &s->cl;
|
||||||
c->localid = alloc_channel_id(s->channels, struct ssh2_channel);
|
c->localid = alloc_channel_id(s->channels, struct ssh2_channel);
|
||||||
add234(s->channels, c);
|
add234(s->channels, c);
|
||||||
}
|
}
|
||||||
|
@ -157,6 +157,7 @@ struct SshChannelVtable {
|
|||||||
|
|
||||||
struct SshChannel {
|
struct SshChannel {
|
||||||
const struct SshChannelVtable *vt;
|
const struct SshChannelVtable *vt;
|
||||||
|
ConnectionLayer *cl;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define sshfwd_write(c, buf, len) ((c)->vt->write(c, buf, len))
|
#define sshfwd_write(c, buf, len) ((c)->vt->write(c, buf, len))
|
||||||
|
Loading…
Reference in New Issue
Block a user