1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 12:02:47 -05:00

Localise user_input to SSH connection layers.

Now that the SSH backend's user_input bufchain is no longer needed for
handling userpass input, it doesn't have to be awkwardly shared
between all the packet protocol layers any more. So we can turn the
want_user_input and got_user_input methods of PacketProtocolLayer into
methods of ConnectionLayer, and then only the two connection layers
have to bother implementing them, or store a pointer to the bufchain
they read from.
This commit is contained in:
Simon Tatham
2021-09-14 14:00:05 +01:00
parent d1374c5890
commit 3037258808
14 changed files with 60 additions and 118 deletions

View File

@ -73,8 +73,6 @@ static bool ssh2_transport_get_specials(
PacketProtocolLayer *ppl, add_special_fn_t add_special, void *ctx);
static void ssh2_transport_special_cmd(PacketProtocolLayer *ppl,
SessionSpecialCode code, int arg);
static bool ssh2_transport_want_user_input(PacketProtocolLayer *ppl);
static void ssh2_transport_got_user_input(PacketProtocolLayer *ppl);
static void ssh2_transport_reconfigure(PacketProtocolLayer *ppl, Conf *conf);
static size_t ssh2_transport_queued_data_size(PacketProtocolLayer *ppl);
@ -87,8 +85,6 @@ static const PacketProtocolLayerVtable ssh2_transport_vtable = {
.process_queue = ssh2_transport_process_queue,
.get_specials = ssh2_transport_get_specials,
.special_cmd = ssh2_transport_special_cmd,
.want_user_input = ssh2_transport_want_user_input,
.got_user_input = ssh2_transport_got_user_input,
.reconfigure = ssh2_transport_reconfigure,
.queued_data_size = ssh2_transport_queued_data_size,
.name = NULL, /* no protocol name for this layer */
@ -2132,24 +2128,6 @@ static void ssh2_transport_reconfigure(PacketProtocolLayer *ppl, Conf *conf)
ssh_ppl_reconfigure(s->higher_layer, conf);
}
static bool ssh2_transport_want_user_input(PacketProtocolLayer *ppl)
{
struct ssh2_transport_state *s =
container_of(ppl, struct ssh2_transport_state, ppl);
/* Just delegate this to the higher layer */
return ssh_ppl_want_user_input(s->higher_layer);
}
static void ssh2_transport_got_user_input(PacketProtocolLayer *ppl)
{
struct ssh2_transport_state *s =
container_of(ppl, struct ssh2_transport_state, ppl);
/* Just delegate this to the higher layer */
ssh_ppl_got_user_input(s->higher_layer);
}
static int weak_algorithm_compare(void *av, void *bv)
{
uintptr_t a = (uintptr_t)av, b = (uintptr_t)bv;