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

Make {term,}get_userpass_input take a bufchain.

NFC for the moment, because the bufchain is always specially
constructed to hold exactly the same data that would have been passed
in to the function as a (pointer,length) pair. But this API change
allows get_userpass_input to express the idea that it consumed some
but not all of the data in the bufchain, which means that later on
I'll be able to point the same function at a longer-lived bufchain
containing the full stream of keyboard input and avoid dropping
keystrokes that arrive too quickly after the end of an interactive
password prompt.
This commit is contained in:
Simon Tatham
2018-05-18 07:22:57 +01:00
parent 7400653bc8
commit 9d495b2176
10 changed files with 88 additions and 42 deletions

View File

@ -321,13 +321,13 @@ int from_backend_eof(void *frontend)
return TRUE; /* do respond to incoming EOF with outgoing */
}
int get_userpass_input(prompts_t *p, const unsigned char *in, int inlen)
int get_userpass_input(prompts_t *p, bufchain *input)
{
struct gui_data *inst = (struct gui_data *)p->frontend;
int ret;
ret = cmdline_get_passwd_input(p);
if (ret == -1)
ret = term_get_userpass_input(inst->term, p, in, inlen);
ret = term_get_userpass_input(inst->term, p, input);
return ret;
}

View File

@ -432,7 +432,7 @@ int from_backend_eof(void *frontend_handle)
return FALSE; /* do not respond to incoming EOF with outgoing */
}
int get_userpass_input(prompts_t *p, const unsigned char *in, int inlen)
int get_userpass_input(prompts_t *p, bufchain *input)
{
int ret;
ret = cmdline_get_passwd_input(p);

View File

@ -68,7 +68,7 @@ Filename *platform_default_filename(const char *name)
char *get_ttymode(void *frontend, const char *mode) { return NULL; }
int get_userpass_input(prompts_t *p, const unsigned char *in, int inlen)
int get_userpass_input(prompts_t *p, bufchain *input)
{
int ret;
ret = cmdline_get_passwd_input(p);