1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 03:52:49 -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

@ -706,9 +706,9 @@ char *get_ttymode(void *frontend, const char *mode);
/*
* >0 = `got all results, carry on'
* 0 = `user cancelled' (FIXME distinguish "give up entirely" and "next auth"?)
* <0 = `please call back later with more in/inlen'
* <0 = `please call back later with a fuller bufchain'
*/
int get_userpass_input(prompts_t *p, const unsigned char *in, int inlen);
int get_userpass_input(prompts_t *p, bufchain *input);
#define OPTIMISE_IS_SCROLL 1
void set_iconic(void *frontend, int iconic);
@ -1119,8 +1119,7 @@ void term_provide_resize_fn(Terminal *term,
void term_provide_logctx(Terminal *term, void *logctx);
void term_set_focus(Terminal *term, int has_focus);
char *term_get_ttymode(Terminal *term, const char *mode);
int term_get_userpass_input(Terminal *term, prompts_t *p,
const unsigned char *in, int inlen);
int term_get_userpass_input(Terminal *term, prompts_t *p, bufchain *input);
int format_arrow_key(char *buf, Terminal *term, int xkey, int ctrl);